Skip to content

Commit 4b2ca39

Browse files
committed
Change ClientNameSuffix to IdentitySuffix
1 parent 647e2bd commit 4b2ca39

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ type Options struct {
146146
DisableIndentity bool
147147

148148
// Add suffix to client name. Default is empty.
149-
ClientNameSuffix string
149+
IdentitySuffix string
150150
}
151151

152152
func (opt *Options) init() {

osscluster.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ type ClusterOptions struct {
8787
TLSConfig *tls.Config
8888
DisableIndentity bool // Disable set-lib on connect. Default is false.
8989

90-
ClientNameSuffix string // Add suffix to client name. Default is empty.
90+
IdentitySuffix string // Add suffix to client name. Default is empty.
9191
}
9292

9393
func (opt *ClusterOptions) init() {
@@ -293,7 +293,7 @@ func (opt *ClusterOptions) clientOptions() *Options {
293293
ConnMaxIdleTime: opt.ConnMaxIdleTime,
294294
ConnMaxLifetime: opt.ConnMaxLifetime,
295295
DisableIndentity: opt.DisableIndentity,
296-
ClientNameSuffix: opt.ClientNameSuffix,
296+
IdentitySuffix: opt.IdentitySuffix,
297297
TLSConfig: opt.TLSConfig,
298298
// If ClusterSlots is populated, then we probably have an artificial
299299
// cluster whose nodes are not in clustering mode (otherwise there isn't

redis.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error {
315315
if !c.opt.DisableIndentity {
316316
libName := ""
317317
libVer := Version()
318-
if c.opt.ClientNameSuffix != "" {
319-
libName = libName + c.opt.ClientNameSuffix
318+
if c.opt.IdentitySuffix != "" {
319+
libName = c.opt.IdentitySuffix
320320
}
321321
libInfo := LibraryInfo{LibName: &libName}
322322
conn.ClientSetInfo(ctx, libInfo)

ring.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ type RingOptions struct {
9999
Limiter Limiter
100100

101101
DisableIndentity bool
102-
ClientNameSuffix string
102+
IdentitySuffix string
103103
}
104104

105105
func (opt *RingOptions) init() {
@@ -167,6 +167,7 @@ func (opt *RingOptions) clientOptions() *Options {
167167
Limiter: opt.Limiter,
168168

169169
DisableIndentity: opt.DisableIndentity,
170+
IdentitySuffix: opt.IdentitySuffix,
170171
}
171172
}
172173

sentinel.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ type FailoverOptions struct {
8181
TLSConfig *tls.Config
8282

8383
DisableIndentity bool
84-
ClientNameSuffix string
84+
IdentitySuffix string
8585
}
8686

8787
func (opt *FailoverOptions) clientOptions() *Options {
@@ -118,7 +118,7 @@ func (opt *FailoverOptions) clientOptions() *Options {
118118
TLSConfig: opt.TLSConfig,
119119

120120
DisableIndentity: opt.DisableIndentity,
121-
ClientNameSuffix: opt.ClientNameSuffix,
121+
IdentitySuffix: opt.IdentitySuffix,
122122
}
123123
}
124124

universal.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ type UniversalOptions struct {
6767
MasterName string
6868

6969
DisableIndentity bool
70-
ClientNameSuffix string
70+
IdentitySuffix string
7171
}
7272

7373
// Cluster returns cluster options created from the universal options.
@@ -113,7 +113,7 @@ func (o *UniversalOptions) Cluster() *ClusterOptions {
113113
TLSConfig: o.TLSConfig,
114114

115115
DisableIndentity: o.DisableIndentity,
116-
ClientNameSuffix: o.ClientNameSuffix,
116+
IdentitySuffix: o.IdentitySuffix,
117117
}
118118
}
119119

@@ -159,7 +159,7 @@ func (o *UniversalOptions) Failover() *FailoverOptions {
159159
TLSConfig: o.TLSConfig,
160160

161161
DisableIndentity: o.DisableIndentity,
162-
ClientNameSuffix: o.ClientNameSuffix,
162+
IdentitySuffix: o.IdentitySuffix,
163163
}
164164
}
165165

@@ -202,7 +202,7 @@ func (o *UniversalOptions) Simple() *Options {
202202
TLSConfig: o.TLSConfig,
203203

204204
DisableIndentity: o.DisableIndentity,
205-
ClientNameSuffix: o.ClientNameSuffix,
205+
IdentitySuffix: o.IdentitySuffix,
206206
}
207207
}
208208

0 commit comments

Comments
 (0)