diff options
| author | Nicolas Paul <n@nc0.fr> | 2023-04-16 20:09:08 +0200 | 
|---|---|---|
| committer | Nicolas Paul <n@nc0.fr> | 2023-04-16 20:09:08 +0200 | 
| commit | efc9e73404efc108c69b4498acb312d760cf8e5d (patch) | |
| tree | a6522428a9b92ff52ff4d590b23067b22e4960d5 /vendor/google.golang.org/api/googleapi/transport/apikey.go | |
| parent | 1f9284de04ae5c996e4218918822297280ede164 (diff) | |
Go mod tidy
Diffstat (limited to 'vendor/google.golang.org/api/googleapi/transport/apikey.go')
| -rw-r--r-- | vendor/google.golang.org/api/googleapi/transport/apikey.go | 44 | 
1 files changed, 0 insertions, 44 deletions
diff --git a/vendor/google.golang.org/api/googleapi/transport/apikey.go b/vendor/google.golang.org/api/googleapi/transport/apikey.go deleted file mode 100644 index f5d826c..0000000 --- a/vendor/google.golang.org/api/googleapi/transport/apikey.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2012 Google LLC. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package transport contains HTTP transports used to make -// authenticated API requests. -// -// This package is DEPRECATED. Users should instead use, -// -//	service, err := NewService(..., option.WithAPIKey(...)) -package transport - -import ( -	"errors" -	"net/http" -) - -// APIKey is an HTTP Transport which wraps an underlying transport and -// appends an API Key "key" parameter to the URL of outgoing requests. -// -// Deprecated: please use NewService(..., option.WithAPIKey(...)) instead. -type APIKey struct { -	// Key is the API Key to set on requests. -	Key string - -	// Transport is the underlying HTTP transport. -	// If nil, http.DefaultTransport is used. -	Transport http.RoundTripper -} - -func (t *APIKey) RoundTrip(req *http.Request) (*http.Response, error) { -	rt := t.Transport -	if rt == nil { -		rt = http.DefaultTransport -		if rt == nil { -			return nil, errors.New("googleapi/transport: no Transport specified or available") -		} -	} -	newReq := *req -	args := newReq.URL.Query() -	args.Set("key", t.Key) -	newReq.URL.RawQuery = args.Encode() -	return rt.RoundTrip(&newReq) -}  | 
