Documentation ¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.
Index ¶
- Constants
- func GetSwagger() (swagger *openapi3.T, err error)
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- func NewPostNamespacesNsEstimatorsNameValuesPowerconsumptionRequest(server string, ns string, name string, ...) (*http.Request, error)
- func NewPostNamespacesNsEstimatorsNameValuesPowerconsumptionRequestWithBody(server string, ns string, name string, contentType string, body io.Reader) (*http.Request, error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type ChiServerOptions
- type Client
- func (c *Client) PostNamespacesNsEstimatorsNameValuesPowerconsumption(ctx context.Context, ns string, name string, ...) (*http.Response, error)
- func (c *Client) PostNamespacesNsEstimatorsNameValuesPowerconsumptionWithBody(ctx context.Context, ns string, name string, contentType string, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) PostNamespacesNsEstimatorsNameValuesPowerconsumptionWithBodyWithResponse(ctx context.Context, ns string, name string, contentType string, ...) (*PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse, error)
- func (c *ClientWithResponses) PostNamespacesNsEstimatorsNameValuesPowerconsumptionWithResponse(ctx context.Context, ns string, name string, ...) (*PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse, error)
- type ClientWithResponsesInterface
- type Error
- type HttpRequestDoer
- type InvalidParamFormatError
- type MiddlewareFunc
- type PostNamespacesNsEstimatorsNameValuesPowerconsumption200JSONResponse
- type PostNamespacesNsEstimatorsNameValuesPowerconsumption400JSONResponse
- type PostNamespacesNsEstimatorsNameValuesPowerconsumption401Response
- type PostNamespacesNsEstimatorsNameValuesPowerconsumption404JSONResponse
- type PostNamespacesNsEstimatorsNameValuesPowerconsumption500JSONResponse
- type PostNamespacesNsEstimatorsNameValuesPowerconsumptionJSONRequestBody
- type PostNamespacesNsEstimatorsNameValuesPowerconsumptionRequestObject
- type PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse
- type PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponseObject
- type PowerConsumption
- type RequestEditorFn
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshallingParamError
Constants ¶
const (
ApiKeyAuthScopes = "apiKeyAuth.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerFromMuxWithBaseURL ¶
func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
func NewPostNamespacesNsEstimatorsNameValuesPowerconsumptionRequest ¶
func NewPostNamespacesNsEstimatorsNameValuesPowerconsumptionRequest(server string, ns string, name string, body PostNamespacesNsEstimatorsNameValuesPowerconsumptionJSONRequestBody) (*http.Request, error)
NewPostNamespacesNsEstimatorsNameValuesPowerconsumptionRequest calls the generic PostNamespacesNsEstimatorsNameValuesPowerconsumption builder with application/json body
func NewPostNamespacesNsEstimatorsNameValuesPowerconsumptionRequestWithBody ¶
func NewPostNamespacesNsEstimatorsNameValuesPowerconsumptionRequestWithBody(server string, ns string, name string, contentType string, body io.Reader) (*http.Request, error)
NewPostNamespacesNsEstimatorsNameValuesPowerconsumptionRequestWithBody generates requests for PostNamespacesNsEstimatorsNameValuesPowerconsumption with any type of body
Types ¶
type ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type Client ¶
type Client struct { // The endpoint of the server conforming to this interface, with scheme, // https://api.deepmap.com for example. This can contain a path relative // to the server, such as https://api.deepmap.com/dev-test, and all the // paths in the swagger spec will be appended to the server. Server string // Doer for performing requests, typically a *http.Client with any // customized settings, such as certificate chains. Client HttpRequestDoer // A list of callbacks for modifying requests which are generated before sending over // the network. RequestEditors []RequestEditorFn }
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) PostNamespacesNsEstimatorsNameValuesPowerconsumption ¶
func (c *Client) PostNamespacesNsEstimatorsNameValuesPowerconsumption(ctx context.Context, ns string, name string, body PostNamespacesNsEstimatorsNameValuesPowerconsumptionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface { // PostNamespacesNsEstimatorsNameValuesPowerconsumption request with any body PostNamespacesNsEstimatorsNameValuesPowerconsumptionWithBody(ctx context.Context, ns string, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) PostNamespacesNsEstimatorsNameValuesPowerconsumption(ctx context.Context, ns string, name string, body PostNamespacesNsEstimatorsNameValuesPowerconsumptionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) }
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) PostNamespacesNsEstimatorsNameValuesPowerconsumptionWithBodyWithResponse ¶
func (c *ClientWithResponses) PostNamespacesNsEstimatorsNameValuesPowerconsumptionWithBodyWithResponse(ctx context.Context, ns string, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse, error)
PostNamespacesNsEstimatorsNameValuesPowerconsumptionWithBodyWithResponse request with arbitrary body returning *PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse
func (*ClientWithResponses) PostNamespacesNsEstimatorsNameValuesPowerconsumptionWithResponse ¶
func (c *ClientWithResponses) PostNamespacesNsEstimatorsNameValuesPowerconsumptionWithResponse(ctx context.Context, ns string, name string, body PostNamespacesNsEstimatorsNameValuesPowerconsumptionJSONRequestBody, reqEditors ...RequestEditorFn) (*PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface { // PostNamespacesNsEstimatorsNameValuesPowerconsumption request with any body PostNamespacesNsEstimatorsNameValuesPowerconsumptionWithBodyWithResponse(ctx context.Context, ns string, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse, error) PostNamespacesNsEstimatorsNameValuesPowerconsumptionWithResponse(ctx context.Context, ns string, name string, body PostNamespacesNsEstimatorsNameValuesPowerconsumptionJSONRequestBody, reqEditors ...RequestEditorFn) (*PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse, error) }
ClientWithResponsesInterface is the interface specification for the client with responses above.
type Error ¶
type Error struct { // Code A code representing the type of the error, same as error name in Go. Code string `json:"code"` // Message A message detailing the error. Message string `json:"message"` }
Error defines model for Error.
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type PostNamespacesNsEstimatorsNameValuesPowerconsumption200JSONResponse ¶
type PostNamespacesNsEstimatorsNameValuesPowerconsumption200JSONResponse PowerConsumption
func (PostNamespacesNsEstimatorsNameValuesPowerconsumption200JSONResponse) VisitPostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse ¶
func (response PostNamespacesNsEstimatorsNameValuesPowerconsumption200JSONResponse) VisitPostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse(w http.ResponseWriter) error
type PostNamespacesNsEstimatorsNameValuesPowerconsumption400JSONResponse ¶
type PostNamespacesNsEstimatorsNameValuesPowerconsumption400JSONResponse Error
func (PostNamespacesNsEstimatorsNameValuesPowerconsumption400JSONResponse) VisitPostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse ¶
func (response PostNamespacesNsEstimatorsNameValuesPowerconsumption400JSONResponse) VisitPostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse(w http.ResponseWriter) error
type PostNamespacesNsEstimatorsNameValuesPowerconsumption401Response ¶
type PostNamespacesNsEstimatorsNameValuesPowerconsumption401Response struct { }
func (PostNamespacesNsEstimatorsNameValuesPowerconsumption401Response) VisitPostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse ¶
func (response PostNamespacesNsEstimatorsNameValuesPowerconsumption401Response) VisitPostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse(w http.ResponseWriter) error
type PostNamespacesNsEstimatorsNameValuesPowerconsumption404JSONResponse ¶
type PostNamespacesNsEstimatorsNameValuesPowerconsumption404JSONResponse Error
func (PostNamespacesNsEstimatorsNameValuesPowerconsumption404JSONResponse) VisitPostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse ¶
func (response PostNamespacesNsEstimatorsNameValuesPowerconsumption404JSONResponse) VisitPostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse(w http.ResponseWriter) error
type PostNamespacesNsEstimatorsNameValuesPowerconsumption500JSONResponse ¶
type PostNamespacesNsEstimatorsNameValuesPowerconsumption500JSONResponse Error
func (PostNamespacesNsEstimatorsNameValuesPowerconsumption500JSONResponse) VisitPostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse ¶
func (response PostNamespacesNsEstimatorsNameValuesPowerconsumption500JSONResponse) VisitPostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse(w http.ResponseWriter) error
type PostNamespacesNsEstimatorsNameValuesPowerconsumptionJSONRequestBody ¶
type PostNamespacesNsEstimatorsNameValuesPowerconsumptionJSONRequestBody = PowerConsumption
PostNamespacesNsEstimatorsNameValuesPowerconsumptionJSONRequestBody defines body for PostNamespacesNsEstimatorsNameValuesPowerconsumption for application/json ContentType.
type PostNamespacesNsEstimatorsNameValuesPowerconsumptionRequestObject ¶
type PostNamespacesNsEstimatorsNameValuesPowerconsumptionRequestObject struct { Ns string `json:"ns"` Name string `json:"name"` Body *PostNamespacesNsEstimatorsNameValuesPowerconsumptionJSONRequestBody }
type PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse ¶
type PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse struct { Body []byte HTTPResponse *http.Response JSON200 *PowerConsumption JSON400 *Error JSON404 *Error JSON500 *Error }
func ParsePostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse ¶
func ParsePostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse(rsp *http.Response) (*PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse, error)
ParsePostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse parses an HTTP response from a PostNamespacesNsEstimatorsNameValuesPowerconsumptionWithResponse call
func (PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse) Status ¶
func (r PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse) Status() string
Status returns HTTPResponse.Status
func (PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse) StatusCode ¶
func (r PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponseObject ¶
type PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponseObject interface {
VisitPostNamespacesNsEstimatorsNameValuesPowerconsumptionResponse(w http.ResponseWriter) error
}
type PowerConsumption ¶
type PowerConsumption struct { // CpuMilli The amount of CPUs required by each workload. CpuMilli int `json:"cpu_milli"` // NumWorkloads The amount of workloads have to be allocated. NumWorkloads int `json:"num_workloads"` // WattIncreases The estimated power increase per workload. WattIncreases *[]float64 `json:"watt_increases,omitempty"` }
PowerConsumption defines model for PowerConsumption.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type RequiredHeaderError ¶
func (*RequiredHeaderError) Error ¶
func (e *RequiredHeaderError) Error() string
func (*RequiredHeaderError) Unwrap ¶
func (e *RequiredHeaderError) Unwrap() error
type RequiredParamError ¶
type RequiredParamError struct {
ParamName string
}
func (*RequiredParamError) Error ¶
func (e *RequiredParamError) Error() string
type ServerInterface ¶
type ServerInterface interface { // Send a power consumption estimate request. // (POST /namespaces/{ns}/estimators/{name}/values/powerconsumption) PostNamespacesNsEstimatorsNameValuesPowerconsumption(w http.ResponseWriter, r *http.Request, ns string, name string) }
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
func NewStrictHandlerWithOptions ¶
func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct { Handler ServerInterface HandlerMiddlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) PostNamespacesNsEstimatorsNameValuesPowerconsumption ¶
func (siw *ServerInterfaceWrapper) PostNamespacesNsEstimatorsNameValuesPowerconsumption(w http.ResponseWriter, r *http.Request)
PostNamespacesNsEstimatorsNameValuesPowerconsumption operation middleware
type StrictHTTPServerOptions ¶
type StrictHTTPServerOptions struct { RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type StrictHandlerFunc ¶
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc
type StrictServerInterface ¶
type StrictServerInterface interface { // Send a power consumption estimate request. // (POST /namespaces/{ns}/estimators/{name}/values/powerconsumption) PostNamespacesNsEstimatorsNameValuesPowerconsumption(ctx context.Context, request PostNamespacesNsEstimatorsNameValuesPowerconsumptionRequestObject) (PostNamespacesNsEstimatorsNameValuesPowerconsumptionResponseObject, error) }
StrictServerInterface represents all server handlers.
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type UnmarshallingParamError ¶
func (*UnmarshallingParamError) Error ¶
func (e *UnmarshallingParamError) Error() string
func (*UnmarshallingParamError) Unwrap ¶
func (e *UnmarshallingParamError) Unwrap() error