From baf7141d1dd0f99d561a2197a909c66dd389809d Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Sat, 8 Oct 2016 16:02:50 -0500 Subject: Update dependencies --- vendor/google.golang.org/api/option/option.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'vendor/google.golang.org/api/option/option.go') diff --git a/vendor/google.golang.org/api/option/option.go b/vendor/google.golang.org/api/option/option.go index 556a6df..b935e6d 100644 --- a/vendor/google.golang.org/api/option/option.go +++ b/vendor/google.golang.org/api/option/option.go @@ -26,6 +26,21 @@ func (w withTokenSource) Apply(o *internal.DialSettings) { o.TokenSource = w.ts } +// WithServiceAccountFile returns a ClientOption that uses a Google service +// account credentials file to authenticate. +// Use WithTokenSource with a token source created from +// golang.org/x/oauth2/google.JWTConfigFromJSON +// if reading the file from disk is not an option. +func WithServiceAccountFile(filename string) ClientOption { + return withServiceAccountFile(filename) +} + +type withServiceAccountFile string + +func (w withServiceAccountFile) Apply(o *internal.DialSettings) { + o.ServiceAccountJSONFilename = string(w) +} + // WithEndpoint returns a ClientOption that overrides the default endpoint // to be used for a service. func WithEndpoint(url string) ClientOption { -- cgit v1.2.3