agones.dev/agones@v1.54.0/test/sdk/restapi/alpha/swagger/configuration.go (about) 1 // Copyright 2024 Google LLC All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // This code was autogenerated. Do not edit directly. 16 /* 17 * alpha.proto 18 * 19 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) 20 * 21 * API version: version not set 22 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) 23 */ 24 package swagger 25 26 import ( 27 "net/http" 28 ) 29 30 // contextKeys are used to identify the type of value in the context. 31 // Since these are string, it is possible to get a short description of the 32 // context key for logging and debugging using key.String(). 33 34 type contextKey string 35 36 func (c contextKey) String() string { 37 return "auth " + string(c) 38 } 39 40 var ( 41 // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. 42 ContextOAuth2 = contextKey("token") 43 44 // ContextBasicAuth takes BasicAuth as authentication for the request. 45 ContextBasicAuth = contextKey("basic") 46 47 // ContextAccessToken takes a string oauth2 access token as authentication for the request. 48 ContextAccessToken = contextKey("accesstoken") 49 50 // ContextAPIKey takes an APIKey as authentication for the request 51 ContextAPIKey = contextKey("apikey") 52 ) 53 54 // BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth 55 type BasicAuth struct { 56 UserName string `json:"userName,omitempty"` 57 Password string `json:"password,omitempty"` 58 } 59 60 // APIKey provides API key based authentication to a request passed via context using ContextAPIKey 61 type APIKey struct { 62 Key string 63 Prefix string 64 } 65 66 type Configuration struct { 67 BasePath string `json:"basePath,omitempty"` 68 Host string `json:"host,omitempty"` 69 Scheme string `json:"scheme,omitempty"` 70 DefaultHeader map[string]string `json:"defaultHeader,omitempty"` 71 UserAgent string `json:"userAgent,omitempty"` 72 HTTPClient *http.Client 73 } 74 75 func NewConfiguration() *Configuration { 76 cfg := &Configuration{ 77 BasePath: "/", 78 DefaultHeader: make(map[string]string), 79 UserAgent: "Swagger-Codegen/1.0.0/go", 80 } 81 return cfg 82 } 83 84 func (c *Configuration) AddDefaultHeader(key string, value string) { 85 c.DefaultHeader[key] = value 86 }