Documentation ¶
Index ¶
Constants ¶
const ( // DefaultHost is the default Host // found in Meta (info) section of spec file DefaultHost string = "localhost" // DefaultBasePath is the default BasePath // found in Meta (info) section of spec file DefaultBasePath string = "/" )
const ( EnvBaseURL = "SCHEDULING_API_BASE_URL" EnvTokenURL = "SCHEDULING_API_TOKEN_URL" EnvClientID = "SCHEDULING_API_CLIENT_ID" EnvClientSecret = "SCHEDULING_API_CLIENT_SECRET" )
Variables ¶
var ( ErrMissingBaseURL = fmt.Errorf("new scheduling api: missing base URL, pass in a complete config or set the environment variable %s", EnvBaseURL) ErrMissingTokenURL = fmt.Errorf("new scheduling api: missing token URL, pass in a complete config or set the environment variable %s", EnvTokenURL) ErrMissingClientID = fmt.Errorf("new scheduling api: missing client id, pass in a complete config or set the environment variable %s", EnvClientID) ErrMissingClientSecret = fmt.Errorf("new scheduling api: missing client secret, pass in a complete config or set the environment variable %s", EnvClientSecret) )
var Default = NewHTTPClient(nil)
Default API proto HTTP client.
var DefaultSchemes = []string{"https"}
DefaultSchemes are the default schemes found in Meta (info) section of spec file
Functions ¶
func DebugRoundTripper ¶
func DebugRoundTripper(base http.RoundTripper) http.RoundTripper
func SetUserAgent ¶
func SetUserAgent(inner http.RoundTripper, userAgent string) http.RoundTripper
Types ¶
type API ¶
type API struct { Client *APIProto Config Config HTTPClient *http.Client // contains filtered or unexported fields }
func (*API) AuthInfoWriter ¶
func (a *API) AuthInfoWriter() runtime.ClientAuthInfoWriter
func (*API) Authenticate ¶
func (*API) WithAuth ¶
func (a *API) WithAuth(op *runtime.ClientOperation)
type APIProto ¶
type APIProto struct { Scheduler scheduler.ClientService Transport runtime.ClientTransport }
APIProto is a client for API proto
func New ¶
func New(transport runtime.ClientTransport, formats strfmt.Registry) *APIProto
New creates a new API proto client
func NewHTTPClient ¶
NewHTTPClient creates a new API proto HTTP client.
func NewHTTPClientWithConfig ¶
func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *APIProto
NewHTTPClientWithConfig creates a new API proto HTTP client, using a customizable transport config.
func (*APIProto) SetTransport ¶
func (c *APIProto) SetTransport(transport runtime.ClientTransport)
SetTransport changes the transport on the client and all its subresources
type TransportConfig ¶
TransportConfig contains the transport related info, found in the meta section of the spec file.
func DefaultTransportConfig ¶
func DefaultTransportConfig() *TransportConfig
DefaultTransportConfig creates a TransportConfig with the default settings taken from the meta section of the spec file.
func (*TransportConfig) WithBasePath ¶
func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig
WithBasePath overrides the default basePath, provided by the meta section of the spec file.
func (*TransportConfig) WithHost ¶
func (cfg *TransportConfig) WithHost(host string) *TransportConfig
WithHost overrides the default host, provided by the meta section of the spec file.
func (*TransportConfig) WithSchemes ¶
func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig
WithSchemes overrides the default schemes, provided by the meta section of the spec file.