aboutsummaryrefslogtreecommitdiff
path: root/vendor/google.golang.org/api/internal
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/google.golang.org/api/internal')
-rw-r--r--vendor/google.golang.org/api/internal/creds.go42
-rw-r--r--vendor/google.golang.org/api/internal/pool.go59
-rw-r--r--vendor/google.golang.org/api/internal/service-account.json12
-rw-r--r--vendor/google.golang.org/api/internal/settings.go62
4 files changed, 0 insertions, 175 deletions
diff --git a/vendor/google.golang.org/api/internal/creds.go b/vendor/google.golang.org/api/internal/creds.go
deleted file mode 100644
index c16b7b6..0000000
--- a/vendor/google.golang.org/api/internal/creds.go
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2017 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package internal
-
-import (
- "fmt"
- "io/ioutil"
-
- "golang.org/x/net/context"
- "golang.org/x/oauth2/google"
-)
-
-// Creds returns credential information obtained from DialSettings, or if none, then
-// it returns default credential information.
-func Creds(ctx context.Context, ds *DialSettings) (*google.DefaultCredentials, error) {
- if ds.Credentials != nil {
- return ds.Credentials, nil
- }
- if ds.CredentialsFile != "" {
- data, err := ioutil.ReadFile(ds.CredentialsFile)
- if err != nil {
- return nil, fmt.Errorf("cannot read credentials file: %v", err)
- }
- return google.CredentialsFromJSON(ctx, data, ds.Scopes...)
- }
- if ds.TokenSource != nil {
- return &google.DefaultCredentials{TokenSource: ds.TokenSource}, nil
- }
- return google.FindDefaultCredentials(ctx, ds.Scopes...)
-}
diff --git a/vendor/google.golang.org/api/internal/pool.go b/vendor/google.golang.org/api/internal/pool.go
deleted file mode 100644
index 4150feb..0000000
--- a/vendor/google.golang.org/api/internal/pool.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2016 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package internal
-
-import (
- "errors"
- "google.golang.org/grpc/naming"
-)
-
-// PoolResolver provides a fixed list of addresses to load balance between
-// and does not provide further updates.
-type PoolResolver struct {
- poolSize int
- dialOpt *DialSettings
- ch chan []*naming.Update
-}
-
-// NewPoolResolver returns a PoolResolver
-// This is an EXPERIMENTAL API and may be changed or removed in the future.
-func NewPoolResolver(size int, o *DialSettings) *PoolResolver {
- return &PoolResolver{poolSize: size, dialOpt: o}
-}
-
-// Resolve returns a Watcher for the endpoint defined by the DialSettings
-// provided to NewPoolResolver.
-func (r *PoolResolver) Resolve(target string) (naming.Watcher, error) {
- if r.dialOpt.Endpoint == "" {
- return nil, errors.New("No endpoint configured")
- }
- addrs := make([]*naming.Update, 0, r.poolSize)
- for i := 0; i < r.poolSize; i++ {
- addrs = append(addrs, &naming.Update{Op: naming.Add, Addr: r.dialOpt.Endpoint, Metadata: i})
- }
- r.ch = make(chan []*naming.Update, 1)
- r.ch <- addrs
- return r, nil
-}
-
-// Next returns a static list of updates on the first call,
-// and blocks indefinitely until Close is called on subsequent calls.
-func (r *PoolResolver) Next() ([]*naming.Update, error) {
- return <-r.ch, nil
-}
-
-func (r *PoolResolver) Close() {
- close(r.ch)
-}
diff --git a/vendor/google.golang.org/api/internal/service-account.json b/vendor/google.golang.org/api/internal/service-account.json
deleted file mode 100644
index 2cb54c2..0000000
--- a/vendor/google.golang.org/api/internal/service-account.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "type": "service_account",
- "project_id": "project_id",
- "private_key_id": "private_key_id",
- "private_key": "private_key",
- "client_email": "xyz@developer.gserviceaccount.com",
- "client_id": "123",
- "auth_uri": "https://accounts.google.com/o/oauth2/auth",
- "token_uri": "https://accounts.google.com/o/oauth2/token",
- "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
- "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/xyz%40developer.gserviceaccount.com"
-}
diff --git a/vendor/google.golang.org/api/internal/settings.go b/vendor/google.golang.org/api/internal/settings.go
deleted file mode 100644
index 34dfa5a..0000000
--- a/vendor/google.golang.org/api/internal/settings.go
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2017 Google Inc. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Package internal supports the options and transport packages.
-package internal
-
-import (
- "errors"
- "net/http"
-
- "golang.org/x/oauth2"
- "golang.org/x/oauth2/google"
- "google.golang.org/grpc"
-)
-
-// DialSettings holds information needed to establish a connection with a
-// Google API service.
-type DialSettings struct {
- Endpoint string
- Scopes []string
- TokenSource oauth2.TokenSource
- Credentials *google.DefaultCredentials
- CredentialsFile string // if set, Token Source is ignored.
- UserAgent string
- APIKey string
- HTTPClient *http.Client
- GRPCDialOpts []grpc.DialOption
- GRPCConn *grpc.ClientConn
- NoAuth bool
-}
-
-// Validate reports an error if ds is invalid.
-func (ds *DialSettings) Validate() error {
- hasCreds := ds.APIKey != "" || ds.TokenSource != nil || ds.CredentialsFile != "" || ds.Credentials != nil
- if ds.NoAuth && hasCreds {
- return errors.New("options.WithoutAuthentication is incompatible with any option that provides credentials")
- }
- // Credentials should not appear with other options.
- // We currently allow TokenSource and CredentialsFile to coexist.
- // TODO(jba): make TokenSource & CredentialsFile an error (breaking change).
- if ds.Credentials != nil && (ds.APIKey != "" || ds.TokenSource != nil || ds.CredentialsFile != "") {
- return errors.New("multiple credential options provided")
- }
- if ds.HTTPClient != nil && ds.GRPCConn != nil {
- return errors.New("WithHTTPClient is incompatible with WithGRPCConn")
- }
- if ds.HTTPClient != nil && ds.GRPCDialOpts != nil {
- return errors.New("WithHTTPClient is incompatible with gRPC dial options")
- }
- return nil
-}