...

Source file src/github.com/launchdarkly/go-server-sdk-redis-redigo/v2/package_info.go

Documentation: github.com/launchdarkly/go-server-sdk-redis-redigo/v2

     1  // Package ldredis provides a Redis-backed persistent data store for the LaunchDarkly Go SDK.
     2  //
     3  // For more details about how and why you can use a persistent data store, see:
     4  // https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store
     5  //
     6  // To use the Redis data store with the LaunchDarkly client:
     7  //
     8  //     import ldredis "github.com/launchdarkly/go-server-sdk-redis-redigo/v2"
     9  //
    10  //     config := ld.Config{
    11  //         DataStore: ldcomponents.PersistentDataStore(ldredis.DataStore()),
    12  //     }
    13  //     client, err := ld.MakeCustomClient("sdk-key", config, 5*time.Second)
    14  //
    15  // The default Redis pool configuration uses an address of localhost:6379, a maximum of 16
    16  // concurrent connections, and blocking connection requests. You may customize the configuration
    17  // by using the methods of the [StoreBuilder] returned by [DataStore]:
    18  //
    19  //     config := ld.Config{
    20  //         DataStore: ldcomponents.PersistentDataStore(
    21  //             ldredis.DataStore().URL(myRedisURL),
    22  //         ).CacheSeconds(30),
    23  //     }
    24  //
    25  // Note that CacheSeconds() is not a method of [StoreBuilder], but rather a method of
    26  // ldcomponents.PersistentDataStore(), because the caching behavior is provided by the SDK for
    27  // all database integrations.
    28  //
    29  // For advanced customization of the underlying Redigo client, use [StoreBuilder] methods such
    30  // as [StoreBuilder.DialOptions] and [StoreBuilder.Pool]. Note that some Redis client features
    31  // can also be specified as part of the URL: Redigo supports the redis:// syntax
    32  // (https://www.iana.org/assignments/uri-schemes/prov/redis), which can include a password
    33  // and a database number, as well as rediss:// (https://www.iana.org/assignments/uri-schemes/prov/rediss),
    34  // which enables TLS.
    35  //
    36  // If you are also using Redis for other purposes, the data store can coexist with
    37  // other data as long as you are not using the same keys. By default, the keys used by the
    38  // data store will always start with "launchdarkly:"; you can change this to another
    39  // prefix if desired.
    40  package ldredis
    41  

View as plain text