diff --git a/options.go b/options.go index 2564a9b5..4409fe41 100644 --- a/options.go +++ b/options.go @@ -18,6 +18,7 @@ import ( "context" "crypto/rsa" "io/ioutil" + "net/http" "time" "cloud.google.com/go/cloudsqlconn/errtypes" @@ -110,6 +111,15 @@ func WithRefreshTimeout(t time.Duration) DialerOption { } } +// WithHTTPClient configures the underlying SQL Admin API client with the +// provided HTTP client. This option is generally unnecessary except for +// advanced use-cases. +func WithHTTPClient(client *http.Client) DialerOption { + return func(d *dialerConfig) { + d.sqladminOpts = append(d.sqladminOpts, apiopt.WithHTTPClient(client)) + } +} + // WithIAMAuthN enables automatic IAM Authentication. If no token source has // been configured (such as with WithTokenSource, WithCredentialsFile, etc), the // dialer will use the default token source as defined by