diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2016-10-08 16:02:50 -0500 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2016-10-08 16:02:50 -0500 |
commit | baf7141d1dd0f99d561a2197a909c66dd389809d (patch) | |
tree | 92c176f713b0b28893344261b1e567db5e30ba79 /vendor/google.golang.org/api/option | |
parent | 696aebffe56853345d679d4d2b3051236423c6db (diff) |
Update dependencies
Diffstat (limited to 'vendor/google.golang.org/api/option')
-rw-r--r-- | vendor/google.golang.org/api/option/option.go | 15 |
1 files changed, 15 insertions, 0 deletions
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 { |