aboutsummaryrefslogtreecommitdiff
path: root/vendor/google.golang.org/api/googleapi/transport/apikey.go
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2019-07-07 21:33:44 +0100
committerNiall Sheridan <nsheridan@gmail.com>2019-07-07 21:33:44 +0100
commit8c12c6939aab9106db14ec2d11d983bc5b29fb2c (patch)
treef9dc8a7d167c6355e47a65c52d4eb7b9ea03e6c8 /vendor/google.golang.org/api/googleapi/transport/apikey.go
parent0bd454cc448b812da6c693b451d86ff4cadbb6b2 (diff)
Switch to modules
Diffstat (limited to 'vendor/google.golang.org/api/googleapi/transport/apikey.go')
-rw-r--r--vendor/google.golang.org/api/googleapi/transport/apikey.go38
1 files changed, 0 insertions, 38 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 eca1ea2..0000000
--- a/vendor/google.golang.org/api/googleapi/transport/apikey.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2012 Google Inc. 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.
-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.
-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)
-}