Skip to content

Commit

Permalink
feat: add support for configuring the HTTP client (#55)
Browse files Browse the repository at this point in the history
Fixes #54.
  • Loading branch information
enocom authored Nov 11, 2021
1 parent 86f37d7 commit de9e72e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"crypto/rsa"
"io/ioutil"
"net/http"
"time"

"cloud.google.com/go/cloudsqlconn/errtypes"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit de9e72e

Please sign in to comment.