Skip to content

Commit 92ba1d7

Browse files
committed
Rename flag to UnstableResp3
1 parent 7141e19 commit 92ba1d7

File tree

6 files changed

+34
-34
lines changed

6 files changed

+34
-34
lines changed

options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ type Options struct {
155155
IdentitySuffix string
156156

157157
// Enable Unstable mode for Redis Search module with RESP3.
158-
UnstableResp3SearchModule bool
158+
UnstableResp3 bool
159159
}
160160

161161
func (opt *Options) init() {

redis.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,10 @@ func (c *baseClient) process(ctx context.Context, cmd Cmder) error {
415415
func (c *baseClient) assertUnstableCommand(cmd Cmder) bool {
416416
switch cmd.(type) {
417417
case *AggregateCmd, *FTInfoCmd, *FTSpellCheckCmd, *FTSearchCmd, *FTSynDumpCmd:
418-
if c.opt.UnstableResp3SearchModule {
418+
if c.opt.UnstableResp3 {
419419
return true
420420
} else {
421-
panic("RESP3 responses for this command are disabled because they may still change. Please set the flag UnstableResp3SearchModule . See the [README](https://github.com/redis/go-redis/blob/master/README.md) and the release notes for guidance.")
421+
panic("RESP3 responses for this command are disabled because they may still change. Please set the flag UnstableResp3 . See the [README](https://github.com/redis/go-redis/blob/master/README.md) and the release notes for guidance.")
422422
}
423423
default:
424424
return false

ring.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ type RingOptions struct {
9898
TLSConfig *tls.Config
9999
Limiter Limiter
100100

101-
DisableIndentity bool
102-
IdentitySuffix string
103-
UnstableResp3SearchModule bool
101+
DisableIndentity bool
102+
IdentitySuffix string
103+
UnstableResp3 bool
104104
}
105105

106106
func (opt *RingOptions) init() {
@@ -167,9 +167,9 @@ func (opt *RingOptions) clientOptions() *Options {
167167
TLSConfig: opt.TLSConfig,
168168
Limiter: opt.Limiter,
169169

170-
DisableIndentity: opt.DisableIndentity,
171-
IdentitySuffix: opt.IdentitySuffix,
172-
UnstableResp3SearchModule: opt.UnstableResp3SearchModule,
170+
DisableIndentity: opt.DisableIndentity,
171+
IdentitySuffix: opt.IdentitySuffix,
172+
UnstableResp3: opt.UnstableResp3,
173173
}
174174
}
175175

search_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
14241424
var client2 *redis.Client
14251425

14261426
BeforeEach(func() {
1427-
client = redis.NewClient(&redis.Options{Addr: ":6379", Protocol: 3, UnstableResp3SearchModule: true})
1427+
client = redis.NewClient(&redis.Options{Addr: ":6379", Protocol: 3, UnstableResp3: true})
14281428
client2 = redis.NewClient(&redis.Options{Addr: ":6379", Protocol: 3})
14291429
Expect(client.FlushDB(ctx).Err()).NotTo(HaveOccurred())
14301430
})
@@ -1456,7 +1456,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
14561456
Expect(results[1].(map[interface{}]interface{})["extra_attributes"].(map[interface{}]interface{})["CreatedDateTimeUTC"]).
14571457
To(Or(BeEquivalentTo("6373878785249699840"), BeEquivalentTo("6373878758592700416")))
14581458

1459-
// Test with UnstableResp3SearchModule false
1459+
// Test with UnstableResp3 false
14601460
Expect(func() {
14611461
options = &redis.FTAggregateOptions{Apply: []redis.FTAggregateApply{{Field: "@CreatedDateTimeUTC * 10", As: "CreatedDateTimeUTC"}}}
14621462
rawRes, _ := client2.FTAggregateWithArgs(ctx, "idx1", "*", options).RawResult()
@@ -1484,7 +1484,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
14841484
flags = attributes[0].(map[interface{}]interface{})["flags"].([]interface{})
14851485
Expect(flags).To(ConsistOf("SORTABLE", "NOSTEM"))
14861486

1487-
// Test with UnstableResp3SearchModule false
1487+
// Test with UnstableResp3 false
14881488
Expect(func() {
14891489
rawResInfo, _ := client2.FTInfo(ctx, "idx1").RawResult()
14901490
rawValInfo := client2.FTInfo(ctx, "idx1").RawVal()
@@ -1511,7 +1511,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
15111511
results := resSpellCheck.(map[interface{}]interface{})["results"].(map[interface{}]interface{})
15121512
Expect(results["impornant"].([]interface{})[0].(map[interface{}]interface{})["important"]).To(BeEquivalentTo(0.5))
15131513

1514-
// Test with UnstableResp3SearchModule false
1514+
// Test with UnstableResp3 false
15151515
Expect(func() {
15161516
rawResSpellCheck, _ := client2.FTSpellCheck(ctx, "idx1", "impornant").RawResult()
15171517
rawValSpellCheck := client2.FTSpellCheck(ctx, "idx1", "impornant").RawVal()
@@ -1538,7 +1538,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
15381538
totalResults2 := res2.(map[interface{}]interface{})["total_results"]
15391539
Expect(totalResults2).To(BeEquivalentTo(int64(1)))
15401540

1541-
// Test with UnstableResp3SearchModule false
1541+
// Test with UnstableResp3 false
15421542
Expect(func() {
15431543
rawRes2, _ := client2.FTSearchWithArgs(ctx, "txt", "foo bar hello world", &redis.FTSearchOptions{NoContent: true}).RawResult()
15441544
rawVal2 := client2.FTSearchWithArgs(ctx, "txt", "foo bar hello world", &redis.FTSearchOptions{NoContent: true}).RawVal()
@@ -1572,7 +1572,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
15721572
Expect(valSynDump).To(BeEquivalentTo(resSynDump))
15731573
Expect(resSynDump.(map[interface{}]interface{})["baby"]).To(BeEquivalentTo([]interface{}{"id1"}))
15741574

1575-
// Test with UnstableResp3SearchModule false
1575+
// Test with UnstableResp3 false
15761576
Expect(func() {
15771577
rawResSynDump, _ := client2.FTSynDump(ctx, "idx1").RawResult()
15781578
rawValSynDump := client2.FTSynDump(ctx, "idx1").RawVal()
@@ -1593,7 +1593,7 @@ var _ = Describe("RediSearch commands Resp 3", Label("search"), func() {
15931593
Expect(err).NotTo(HaveOccurred())
15941594
Expect(res1).ToNot(BeEmpty())
15951595

1596-
// Test with UnstableResp3SearchModule false
1596+
// Test with UnstableResp3 false
15971597
Expect(func() {
15981598
res2, err := client2.FTExplain(ctx, "txt", "@f3:f3_val @f2:f2_val @f1:f1_val").Result()
15991599
Expect(err).NotTo(HaveOccurred())

sentinel.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ type FailoverOptions struct {
8080

8181
TLSConfig *tls.Config
8282

83-
DisableIndentity bool
84-
IdentitySuffix string
85-
UnstableResp3SearchModule bool
83+
DisableIndentity bool
84+
IdentitySuffix string
85+
UnstableResp3 bool
8686
}
8787

8888
func (opt *FailoverOptions) clientOptions() *Options {
@@ -118,9 +118,9 @@ func (opt *FailoverOptions) clientOptions() *Options {
118118

119119
TLSConfig: opt.TLSConfig,
120120

121-
DisableIndentity: opt.DisableIndentity,
122-
IdentitySuffix: opt.IdentitySuffix,
123-
UnstableResp3SearchModule: opt.UnstableResp3SearchModule,
121+
DisableIndentity: opt.DisableIndentity,
122+
IdentitySuffix: opt.IdentitySuffix,
123+
UnstableResp3: opt.UnstableResp3,
124124
}
125125
}
126126

@@ -156,9 +156,9 @@ func (opt *FailoverOptions) sentinelOptions(addr string) *Options {
156156

157157
TLSConfig: opt.TLSConfig,
158158

159-
DisableIndentity: opt.DisableIndentity,
160-
IdentitySuffix: opt.IdentitySuffix,
161-
UnstableResp3SearchModule: opt.UnstableResp3SearchModule,
159+
DisableIndentity: opt.DisableIndentity,
160+
IdentitySuffix: opt.IdentitySuffix,
161+
UnstableResp3: opt.UnstableResp3,
162162
}
163163
}
164164

universal.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ type UniversalOptions struct {
6666

6767
MasterName string
6868

69-
DisableIndentity bool
70-
IdentitySuffix string
71-
UnstableResp3SearchModule bool
69+
DisableIndentity bool
70+
IdentitySuffix string
71+
UnstableResp3 bool
7272
}
7373

7474
// Cluster returns cluster options created from the universal options.
@@ -159,9 +159,9 @@ func (o *UniversalOptions) Failover() *FailoverOptions {
159159

160160
TLSConfig: o.TLSConfig,
161161

162-
DisableIndentity: o.DisableIndentity,
163-
IdentitySuffix: o.IdentitySuffix,
164-
UnstableResp3SearchModule: o.UnstableResp3SearchModule,
162+
DisableIndentity: o.DisableIndentity,
163+
IdentitySuffix: o.IdentitySuffix,
164+
UnstableResp3: o.UnstableResp3,
165165
}
166166
}
167167

@@ -203,9 +203,9 @@ func (o *UniversalOptions) Simple() *Options {
203203

204204
TLSConfig: o.TLSConfig,
205205

206-
DisableIndentity: o.DisableIndentity,
207-
IdentitySuffix: o.IdentitySuffix,
208-
UnstableResp3SearchModule: o.UnstableResp3SearchModule,
206+
DisableIndentity: o.DisableIndentity,
207+
IdentitySuffix: o.IdentitySuffix,
208+
UnstableResp3: o.UnstableResp3,
209209
}
210210
}
211211

0 commit comments

Comments
 (0)