diff options
Diffstat (limited to 'vendor/google.golang.org/api/gensupport/header.go')
-rw-r--r-- | vendor/google.golang.org/api/gensupport/header.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/google.golang.org/api/gensupport/header.go b/vendor/google.golang.org/api/gensupport/header.go new file mode 100644 index 0000000..cb5e67c --- /dev/null +++ b/vendor/google.golang.org/api/gensupport/header.go | |||
@@ -0,0 +1,22 @@ | |||
1 | // Copyright 2017 The Go Authors. All rights reserved. | ||
2 | // Use of this source code is governed by a BSD-style | ||
3 | // license that can be found in the LICENSE file. | ||
4 | |||
5 | package gensupport | ||
6 | |||
7 | import ( | ||
8 | "fmt" | ||
9 | "runtime" | ||
10 | "strings" | ||
11 | ) | ||
12 | |||
13 | // GoogleClientHeader returns the value to use for the x-goog-api-client | ||
14 | // header, which is used internally by Google. | ||
15 | func GoogleClientHeader(generatorVersion, clientElement string) string { | ||
16 | elts := []string{"gl-go/" + strings.Replace(runtime.Version(), " ", "_", -1)} | ||
17 | if clientElement != "" { | ||
18 | elts = append(elts, clientElement) | ||
19 | } | ||
20 | elts = append(elts, fmt.Sprintf("gdcl/%s", generatorVersion)) | ||
21 | return strings.Join(elts, " ") | ||
22 | } | ||