mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
This tag of hcsshim brings in a couple welcome features/improvements. One being exposing a way to query for hns endpoint statistics (Packets received/sent etc.). This tag also contains some optimizations for querying whether a certain HCN feature is supported, which is a common workflow in kube-proxy on Windows. The first result from querying HCN is now cached so further calls can skip the hcn query as well as the version range parsing that was performed. This also gets rid of some redundant logs that used to hit everytime the version range parsing occurred. The Go-winio dep bump, and all of the ctrd deps are transitive only. Nothing new is needed/intended to be used. Signed-off-by: Daniel Canter <dcanter@microsoft.com>
73 lines
2.1 KiB
Go
73 lines
2.1 KiB
Go
/*
|
|
* HCS API
|
|
*
|
|
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
*
|
|
* API version: 2.1
|
|
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
|
*/
|
|
|
|
package hcsschema
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
// contextKeys are used to identify the type of value in the context.
|
|
// Since these are string, it is possible to get a short description of the
|
|
// context key for logging and debugging using key.String().
|
|
|
|
type contextKey string
|
|
|
|
func (c contextKey) String() string {
|
|
return "auth " + string(c)
|
|
}
|
|
|
|
var (
|
|
// ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
|
|
ContextOAuth2 = contextKey("token")
|
|
|
|
// ContextBasicAuth takes BasicAuth as authentication for the request.
|
|
ContextBasicAuth = contextKey("basic")
|
|
|
|
// ContextAccessToken takes a string oauth2 access token as authentication for the request.
|
|
ContextAccessToken = contextKey("accesstoken")
|
|
|
|
// ContextAPIKey takes an APIKey as authentication for the request
|
|
ContextAPIKey = contextKey("apikey")
|
|
)
|
|
|
|
// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
|
|
type BasicAuth struct {
|
|
UserName string `json:"userName,omitempty"`
|
|
Password string `json:"password,omitempty"`
|
|
}
|
|
|
|
// APIKey provides API key based authentication to a request passed via context using ContextAPIKey
|
|
type APIKey struct {
|
|
Key string
|
|
Prefix string
|
|
}
|
|
|
|
type Configuration struct {
|
|
BasePath string `json:"basePath,omitempty"`
|
|
Host string `json:"host,omitempty"`
|
|
Scheme string `json:"scheme,omitempty"`
|
|
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
|
|
UserAgent string `json:"userAgent,omitempty"`
|
|
HTTPClient *http.Client
|
|
}
|
|
|
|
func NewConfiguration() *Configuration {
|
|
cfg := &Configuration{
|
|
BasePath: "https://localhost",
|
|
DefaultHeader: make(map[string]string),
|
|
UserAgent: "Swagger-Codegen/2.1.0/go",
|
|
}
|
|
return cfg
|
|
}
|
|
|
|
func (c *Configuration) AddDefaultHeader(key string, value string) {
|
|
c.DefaultHeader[key] = value
|
|
}
|