Skip to content

Commit 07b8838

Browse files
committed
add CredentialsProvider to ClusterOptions
1 parent 21bd40a commit 07b8838

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

osscluster.go

Lines changed: 8 additions & 6 deletions
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
@@ -269,9 +270,10 @@ func (opt *ClusterOptions) clientOptions() *Options {
269270
Dialer: opt.Dialer,
270271
OnConnect: opt.OnConnect,
271272

272-
Protocol: opt.Protocol,
273-
Username: opt.Username,
274-
Password: opt.Password,
273+
Protocol: opt.Protocol,
274+
Username: opt.Username,
275+
Password: opt.Password,
276+
CredentialsProvider: opt.CredentialsProvider,
275277

276278
MaxRetries: opt.MaxRetries,
277279
MinRetryBackoff: opt.MinRetryBackoff,

0 commit comments

Comments
 (0)