From 516abe867dbeaa337009dbaf2668b85011996bde Mon Sep 17 00:00:00 2001 From: John Du Hart Date: Wed, 14 Feb 2024 16:03:18 -0500 Subject: [PATCH] add CredentialsProvider to ClusterOptions (#2791) --- osscluster.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/osscluster.go b/osscluster.go index 9e5eb0464..17f98d9dc 100644 --- a/osscluster.go +++ b/osscluster.go @@ -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,