Skip to content

Commit cf6244b

Browse files
authored
chore: update doc links, fix grammar, fix a commented out test (#10)
1 parent 58c520d commit cf6244b

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

package_info.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
// Package ldredis provides a Redis-backed persistent data store for the LaunchDarkly Go SDK.
22
//
33
// 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
4+
// https://docs.launchdarkly.com/sdk/concepts/data-stores
55
//
66
// To use the Redis data store with the LaunchDarkly client:
77
//
8-
// import ldredis "github.com/launchdarkly/go-server-sdk-redis-go-redis"
8+
// import ldredis "github.com/launchdarkly/go-server-sdk-redis-go-redis"
99
//
10-
// config := ld.Config{
11-
// DataStore: ldcomponents.PersistentDataStore(ldredis.DataStore()),
12-
// }
13-
// client, err := ld.MakeCustomClient("sdk-key", config, 5*time.Second)
10+
// config := ld.Config{
11+
// DataStore: ldcomponents.PersistentDataStore(ldredis.DataStore()),
12+
// }
13+
// client, err := ld.MakeCustomClient("sdk-key", config, 5*time.Second)
1414
//
1515
// The default configuration uses an address of localhost:6379. You may customize the configuration
1616
// by using the methods of the ldredis.DataStoreBuilder returned by ldredis.DataStore():
1717
//
18-
// config := ld.Config{
19-
// DataStore: ldcomponents.PersistentDataStore(
20-
// ldredis.DataStore().URL(myRedisURL),
21-
// ).CacheSeconds(30),
22-
// }
18+
// config := ld.Config{
19+
// DataStore: ldcomponents.PersistentDataStore(
20+
// ldredis.DataStore().URL(myRedisURL),
21+
// ).CacheSeconds(30),
22+
// }
2323
//
2424
// Note that CacheSeconds() is not a method of ldredis.DataStoreBuilder, but rather a method of
2525
// ldcomponents.PersistentDataStore(), because the caching behavior is provided by the SDK for
@@ -32,5 +32,5 @@
3232
// If you are also using Redis for other purposes, the data store can coexist with
3333
// other data as long as you are not using the same keys. By default, the keys used by the
3434
// data store will always start with "launchdarkly:"; you can change this to another
35-
// prefix if desired.
35+
// prefix if desired using the ldredis.DataStoreBuilder's Prefix method.
3636
package ldredis

redis_builder.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func DataStore() *DataStoreBuilder {
5555
//
5656
// config.DataStore = ldredis.DataStore().URL("redis://hostname").Prefix("prefix")
5757
//
58-
// You do not need to call the builder's CreatePersistentDataStore() method yourself to build the
58+
// You do not need to call the builder's Build() method yourself to build the
5959
// actual data store; that will be done by the SDK.
6060
type DataStoreBuilder struct {
6161
prefix string
@@ -114,7 +114,7 @@ func (b *DataStoreBuilder) Prefix(prefix string) *DataStoreBuilder {
114114
return b
115115
}
116116

117-
// Options sets all of the parameters supported by the go-redis UniversalOptions type.
117+
// Options sets all the parameters supported by the go-redis UniversalOptions type.
118118
//
119119
// This overwrites any previous setting of HostAndPort or Addresses.
120120
func (b *DataStoreBuilder) Options(options redis.UniversalOptions) *DataStoreBuilder {
@@ -124,7 +124,7 @@ func (b *DataStoreBuilder) Options(options redis.UniversalOptions) *DataStoreBui
124124

125125
// URL specifies the Redis host URL. If not specified, the default value is DefaultURL.
126126
//
127-
// Note that some Redis client features can specified either as part of the URL or with Options. For instance,
127+
// Note that some Redis client features can be specified either as part of the URL or with Options. For instance,
128128
// the Password and DB fields in Options can be part of a "redis://" URL
129129
// (https://www.iana.org/assignments/uri-schemes/prov/redis), and TLS can be enabled either by setting the
130130
// TLSConfig in Options or by using a "rediss://" URL (https://www.iana.org/assignments/uri-schemes/prov/rediss).
@@ -153,7 +153,7 @@ func (b *DataStoreBuilder) Build(
153153

154154
if b.url != "" {
155155
if len(redisOpts.Addrs) > 0 {
156-
return nil, errors.New("Redis data store must be configured with either Options.Address or URL, but not both")
156+
return nil, errors.New("redis data store must be configured with either Options.Address or URL, but not both")
157157
}
158158
parsed, err := redis.ParseURL(b.url)
159159
if err != nil {

redis_builder_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ func TestDataSourceBuilder(t *testing.T) {
3232

3333
assert.Equal(t, DefaultPrefix, makeStore(DataStore().Prefix("")).prefix)
3434

35-
// assert.Equal(t, DefaultClusterPrefix + "p", makeStore(DataStore().Prefix("p").))
35+
assert.Equal(t, DefaultClusterPrefix+"p", makeStore(
36+
DataStore().Addresses("a", "b").Prefix("p")).prefix,
37+
)
3638
})
3739

3840
t.Run("URL", func(t *testing.T) {

0 commit comments

Comments
 (0)