Documentation
¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by unknown module path version unknown version DO NOT EDIT.
Package api provides primitives to interact with the openapi HTTP API.
Code generated by unknown module path version unknown version DO NOT EDIT.
Package api provides primitives to interact with the openapi HTTP API.
Code generated by unknown module path version unknown version DO NOT EDIT.
Index ¶
- 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 NewGetHealthRequest(server string) (*http.Request, error)
- type BadRequest
- type Check
- type CheckData
- type ChiServerOptions
- type Client
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- type ClientWithResponsesInterface
- type GetHealthResponse
- type Health
- type HealthResponse
- type HttpRequestDoer
- type InvalidParamFormatError
- type MiddlewareFunc
- type RequestEditorFn
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- type StandardError
- type Status
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshalingParamError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
Types ¶
type Check ¶
type Check struct { Data CheckData `json:"data"` // Additional information. Detail *string `json:"detail,omitempty"` // Name of health check. Name string `json:"name"` // Reason for check failure. Reason *string `json:"reason,omitempty"` Status Status `json:"status"` }
Check defines model for Check.
type CheckData ¶
type CheckData struct {
AdditionalProperties map[string]interface{} `json:"-"`
}
CheckData defines model for CheckData.
func (CheckData) Get ¶
Getter for additional properties for CheckData. Returns the specified element and whether it was found
func (CheckData) MarshalJSON ¶
Override default JSON handling for CheckData to handle AdditionalProperties
func (*CheckData) UnmarshalJSON ¶
Override default JSON handling for CheckData to handle AdditionalProperties
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.
type ClientInterface ¶
type ClientInterface interface { // GetHealth request GetHealth(ctx context.Context, 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) GetHealthWithResponse ¶
func (c *ClientWithResponses) GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error)
GetHealthWithResponse request returning *GetHealthResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface { // GetHealth request GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error) }
ClientWithResponsesInterface is the interface specification for the client with responses above.
type GetHealthResponse ¶
type GetHealthResponse struct { Body []byte HTTPResponse *http.Response JSON200 *HealthResponse JSON400 *StandardError }
func ParseGetHealthResponse ¶
func ParseGetHealthResponse(rsp *http.Response) (*GetHealthResponse, error)
ParseGetHealthResponse parses an HTTP response from a GetHealthWithResponse call
func (GetHealthResponse) Status ¶
func (r GetHealthResponse) Status() string
Status returns HTTPResponse.Status
func (GetHealthResponse) StatusCode ¶
func (r GetHealthResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Health ¶
type Health struct { // List of health checks. Checks []Check `json:"checks"` Status Status `json:"status"` }
Health defines model for Health.
type HealthResponse ¶
type HealthResponse struct {
Health Health `json:"health"`
}
HealthResponse defines model for HealthResponse.
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 MiddlewareFunc ¶
type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc
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 { // Indicate the service health. // (GET /health) GetHealth(w http.ResponseWriter, r *http.Request) }
ServerInterface represents all server handlers.
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) GetHealth ¶
func (siw *ServerInterfaceWrapper) GetHealth(w http.ResponseWriter, r *http.Request)
GetHealth operation middleware
type StandardError ¶
type StandardError struct { // Error message Error string `json:"error"` }
StandardError defines model for StandardError.
type Status ¶
type Status string
Status defines model for Status.
const ( StatusDegraded Status = "degraded" StatusFailing Status = "failing" StatusPassing Status = "passing" )
Defines values for Status.
func AggregateHealthStatus ¶
AggregateHealthStatus returns the least healthy status of the input.
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