Skip to content

Commit 516abe8

Browse files
authored
add CredentialsProvider to ClusterOptions (#2791)
1 parent 21ed15b commit 516abe8

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

osscluster.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ type ClusterOptions struct {
6262

6363
OnConnect func(ctx context.Context, cn *Conn) error
6464

65-
Protocol int
66-
Username string
67-
Password string
65+
Protocol int
66+
Username string
67+
Password string
68+
CredentialsProvider func() (username string, password string)
6869

6970
MaxRetries int
7071
MinRetryBackoff time.Duration
@@ -271,9 +272,10 @@ func (opt *ClusterOptions) clientOptions() *Options {
271272
Dialer: opt.Dialer,
272273
OnConnect: opt.OnConnect,
273274

274-
Protocol: opt.Protocol,
275-
Username: opt.Username,
276-
Password: opt.Password,
275+
Protocol: opt.Protocol,
276+
Username: opt.Username,
277+
Password: opt.Password,
278+
CredentialsProvider: opt.CredentialsProvider,
277279

278280
MaxRetries: opt.MaxRetries,
279281
MinRetryBackoff: opt.MinRetryBackoff,

0 commit comments

Comments
 (0)