Documentation
¶
Overview ¶
Package v1 provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.6.0 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler
- func NewCmdAddRequest(server string, body CmdAddJSONRequestBody) (*http.Request, error)
- func NewCmdAddRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewHealthRequest(server string) (*http.Request, error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type AddArgs
- type Client
- func (c *Client) CmdAdd(ctx context.Context, body CmdAddJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) CmdAddWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) Health(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) CmdAddWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*CmdAddResponse, error)
- func (c *ClientWithResponses) CmdAddWithResponse(ctx context.Context, body CmdAddJSONRequestBody, reqEditors ...RequestEditorFn) (*CmdAddResponse, error)
- func (c *ClientWithResponses) HealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthResponse, error)
- type ClientWithResponsesInterface
- type CmdAdd200JSONResponse
- type CmdAddJSONRequestBody
- type CmdAddRequestObject
- type CmdAddResponse
- type CmdAddResponseObject
- type CmdAdddefaultJSONResponse
- type DNS
- type Error
- type Health200Response
- type HealthRequestObject
- type HealthResponse
- type HealthResponseObject
- type HttpRequestDoer
- type IPConfig
- type InvalidParamFormatError
- type MiddlewareFunc
- type RequestEditorFn
- type RequiredHeaderError
- type RequiredParamError
- type Result
- type Route
- type ServeMux
- type ServerInterface
- type ServerInterfaceWrapper
- type StdHTTPServerOptions
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshalingParamError
Constants ¶
This section is empty.
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, m ServeMux) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerFromMuxWithBaseURL ¶
func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
func NewCmdAddRequest ¶
func NewCmdAddRequest(server string, body CmdAddJSONRequestBody) (*http.Request, error)
NewCmdAddRequest calls the generic CmdAdd builder with application/json body
func NewCmdAddRequestWithBody ¶
func NewCmdAddRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewCmdAddRequestWithBody generates requests for CmdAdd with any type of body
func NewHealthRequest ¶
NewHealthRequest generates requests for Health
Types ¶
type AddArgs ¶
type AddArgs struct {
ContainerID string `json:"containerID"`
Ipv4 bool `json:"ipv4"`
Ipv6 bool `json:"ipv6"`
PodName string `json:"podName"`
PodNamespace string `json:"podNamespace"`
PodUID string `json:"podUID"`
}
AddArgs defines model for AddArgs.
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) CmdAdd ¶
func (c *Client) CmdAdd(ctx context.Context, body CmdAddJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) CmdAddWithBody ¶
type ClientInterface ¶
type ClientInterface interface {
// Health request
Health(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// CmdAddWithBody request with any body
CmdAddWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CmdAdd(ctx context.Context, body CmdAddJSONRequestBody, 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) CmdAddWithBodyWithResponse ¶
func (c *ClientWithResponses) CmdAddWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CmdAddResponse, error)
CmdAddWithBodyWithResponse request with arbitrary body returning *CmdAddResponse
func (*ClientWithResponses) CmdAddWithResponse ¶
func (c *ClientWithResponses) CmdAddWithResponse(ctx context.Context, body CmdAddJSONRequestBody, reqEditors ...RequestEditorFn) (*CmdAddResponse, error)
func (*ClientWithResponses) HealthWithResponse ¶
func (c *ClientWithResponses) HealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthResponse, error)
HealthWithResponse request returning *HealthResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// HealthWithResponse request
HealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthResponse, error)
// CmdAddWithBodyWithResponse request with any body
CmdAddWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CmdAddResponse, error)
CmdAddWithResponse(ctx context.Context, body CmdAddJSONRequestBody, reqEditors ...RequestEditorFn) (*CmdAddResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type CmdAdd200JSONResponse ¶
type CmdAdd200JSONResponse Result
func (CmdAdd200JSONResponse) VisitCmdAddResponse ¶
func (response CmdAdd200JSONResponse) VisitCmdAddResponse(w http.ResponseWriter) error
type CmdAddJSONRequestBody ¶
type CmdAddJSONRequestBody = AddArgs
CmdAddJSONRequestBody defines body for CmdAdd for application/json ContentType.
type CmdAddRequestObject ¶
type CmdAddRequestObject struct {
Body *CmdAddJSONRequestBody
}
type CmdAddResponse ¶
type CmdAddResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Result
JSONDefault *Error
}
func ParseCmdAddResponse ¶
func ParseCmdAddResponse(rsp *http.Response) (*CmdAddResponse, error)
ParseCmdAddResponse parses an HTTP response from a CmdAddWithResponse call
func (CmdAddResponse) Status ¶
func (r CmdAddResponse) Status() string
Status returns HTTPResponse.Status
func (CmdAddResponse) StatusCode ¶
func (r CmdAddResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type CmdAddResponseObject ¶
type CmdAddResponseObject interface {
VisitCmdAddResponse(w http.ResponseWriter) error
}
type CmdAdddefaultJSONResponse ¶
func (CmdAdddefaultJSONResponse) VisitCmdAddResponse ¶
func (response CmdAdddefaultJSONResponse) VisitCmdAddResponse(w http.ResponseWriter) error
type DNS ¶
type DNS struct {
Domain *string `json:"domain,omitempty"`
Nameservers []string `json:"nameservers"`
Options *[]string `json:"options,omitempty"`
Search *[]string `json:"search,omitempty"`
}
DNS defines model for DNS.
type Health200Response ¶
type Health200Response struct {
}
func (Health200Response) VisitHealthResponse ¶
func (response Health200Response) VisitHealthResponse(w http.ResponseWriter) error
type HealthRequestObject ¶
type HealthRequestObject struct {
}
type HealthResponse ¶
func ParseHealthResponse ¶
func ParseHealthResponse(rsp *http.Response) (*HealthResponse, error)
ParseHealthResponse parses an HTTP response from a HealthWithResponse call
func (HealthResponse) Status ¶
func (r HealthResponse) Status() string
Status returns HTTPResponse.Status
func (HealthResponse) StatusCode ¶
func (r HealthResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HealthResponseObject ¶
type HealthResponseObject interface {
VisitHealthResponse(w http.ResponseWriter) 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 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 Result ¶
type Result struct {
Dns *DNS `json:"dns,omitempty"`
Ips []IPConfig `json:"ips"`
Routes *[]Route `json:"routes,omitempty"`
}
Result defines model for Result.
type ServeMux ¶
type ServeMux interface {
HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
ServeHTTP(w http.ResponseWriter, r *http.Request)
}
ServeMux is an abstraction of http.ServeMux.
type ServerInterface ¶
type ServerInterface interface {
// (GET /health)
Health(w http.ResponseWriter, r *http.Request)
// (POST /ips)
CmdAdd(w http.ResponseWriter, r *http.Request)
}
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) CmdAdd ¶
func (siw *ServerInterfaceWrapper) CmdAdd(w http.ResponseWriter, r *http.Request)
CmdAdd operation middleware
func (*ServerInterfaceWrapper) Health ¶
func (siw *ServerInterfaceWrapper) Health(w http.ResponseWriter, r *http.Request)
Health operation middleware
type StdHTTPServerOptions ¶
type StdHTTPServerOptions struct {
BaseURL string
BaseRouter ServeMux
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
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 StrictHandlerFunc = strictnethttp.StrictHTTPHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = strictnethttp.StrictHTTPMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// (GET /health)
Health(ctx context.Context, request HealthRequestObject) (HealthResponseObject, error)
// (POST /ips)
CmdAdd(ctx context.Context, request CmdAddRequestObject) (CmdAddResponseObject, 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 UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error