From a02d151a6e5c1544bcdf5ad6121585dde4aea037 Mon Sep 17 00:00:00 2001 From: Jonathan Hess Date: Thu, 30 Jun 2022 09:54:10 -0600 Subject: [PATCH 1/2] feat: expose the WithQuotaProject dialer option This option is available as google.golang.org/api/option to the gcloud go api. It needs to be exposed in the cloud sql connector also. --- options.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/options.go b/options.go index 19ad922a..3a73530f 100644 --- a/options.go +++ b/options.go @@ -139,6 +139,14 @@ func WithAdminAPIEndpoint(url string) Option { } } +// WithQuotaProject allows you to change the gcloud project used to track the +// api request quota. +func WithQuotaProject(p string) Option { + return func(cfg *dialerConfig) { + cfg.sqladminOpts = append(cfg.sqladminOpts, apiopt.WithQuotaProject(p)) + } +} + // WithDialFunc configures the function used to connect to the address on the // named network. This option is generally unnecessary except for advanced // use-cases. From b6fc26bb00ea4e16bdf6b7af248221c4ba16f656 Mon Sep 17 00:00:00 2001 From: "Jonathan Hess (he/him)" <103529393+hessjcg@users.noreply.github.com> Date: Fri, 1 Jul 2022 10:11:48 -0600 Subject: [PATCH 2/2] Update options.go Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com> --- options.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/options.go b/options.go index 3a73530f..5f95dcac 100644 --- a/options.go +++ b/options.go @@ -139,8 +139,7 @@ func WithAdminAPIEndpoint(url string) Option { } } -// WithQuotaProject allows you to change the gcloud project used to track the -// api request quota. +// WithQuotaProject returns an Option that specifies the project used for quota and billing purposes. func WithQuotaProject(p string) Option { return func(cfg *dialerConfig) { cfg.sqladminOpts = append(cfg.sqladminOpts, apiopt.WithQuotaProject(p))