credentials_notgo19.go 493 B

12345678910111213141516171819202122
  1. // Copyright 2018 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build !go1.9
  5. package option
  6. import (
  7. "golang.org/x/oauth2/google"
  8. "google.golang.org/api/internal"
  9. )
  10. type withCreds google.DefaultCredentials
  11. func (w *withCreds) Apply(o *internal.DialSettings) {
  12. o.Credentials = (*google.DefaultCredentials)(w)
  13. }
  14. func WithCredentials(creds *google.DefaultCredentials) ClientOption {
  15. return (*withCreds)(creds)
  16. }