add CredentialsProvider to ClusterOptions (#2791)

This commit is contained in:
John Du Hart 2024-02-14 16:03:18 -05:00 committed by GitHub
parent 21ed15bbed
commit 516abe867d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 6 deletions

View File

@ -62,9 +62,10 @@ type ClusterOptions struct {
OnConnect func(ctx context.Context, cn *Conn) error
Protocol int
Username string
Password string
Protocol int
Username string
Password string
CredentialsProvider func() (username string, password string)
MaxRetries int
MinRetryBackoff time.Duration
@ -271,9 +272,10 @@ func (opt *ClusterOptions) clientOptions() *Options {
Dialer: opt.Dialer,
OnConnect: opt.OnConnect,
Protocol: opt.Protocol,
Username: opt.Username,
Password: opt.Password,
Protocol: opt.Protocol,
Username: opt.Username,
Password: opt.Password,
CredentialsProvider: opt.CredentialsProvider,
MaxRetries: opt.MaxRetries,
MinRetryBackoff: opt.MinRetryBackoff,