Documentation
¶
Overview ¶
Package restapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.11.1-0.20220609223533-7da811e1cf30 DO NOT EDIT.
Index ¶
- 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 PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type ChiServerOptions
- type FeatureEnable
- type InvalidParamFormatError
- type MiddlewareFunc
- type PostEnableJSONBody
- type PostEnableJSONRequestBody
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) GetVersion(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostAPIIDStart(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostAPIIDStop(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostEnable(w http.ResponseWriter, r *http.Request)
- 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, 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 ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type FeatureEnable ¶
type FeatureEnable struct { // enable flag Enable *bool `json:"enable,omitempty"` }
Enable/disable a feature
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type PostEnableJSONBody ¶
type PostEnableJSONBody = FeatureEnable
PostEnableJSONBody defines parameters for PostEnable.
type PostEnableJSONRequestBody ¶
type PostEnableJSONRequestBody = PostEnableJSONBody
PostEnableJSONRequestBody defines body for PostEnable for application/json ContentType.
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 { // enable/disable the spec reconstruction // (POST /enable) PostEnable(w http.ResponseWriter, r *http.Request) // Get the version of this Plugin // (GET /version) GetVersion(w http.ResponseWriter, r *http.Request) // Start the spec reconstruction for this API. // (POST /{apiID}/start) PostAPIIDStart(w http.ResponseWriter, r *http.Request, apiID externalRef0.ApiID) // Stop the spec reconstruction for this API. // (POST /{apiID}/stop) PostAPIIDStop(w http.ResponseWriter, r *http.Request, apiID externalRef0.ApiID) }
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) GetVersion ¶
func (siw *ServerInterfaceWrapper) GetVersion(w http.ResponseWriter, r *http.Request)
GetVersion operation middleware
func (*ServerInterfaceWrapper) PostAPIIDStart ¶
func (siw *ServerInterfaceWrapper) PostAPIIDStart(w http.ResponseWriter, r *http.Request)
PostAPIIDStart operation middleware
func (*ServerInterfaceWrapper) PostAPIIDStop ¶
func (siw *ServerInterfaceWrapper) PostAPIIDStop(w http.ResponseWriter, r *http.Request)
PostAPIIDStop operation middleware
func (*ServerInterfaceWrapper) PostEnable ¶
func (siw *ServerInterfaceWrapper) PostEnable(w http.ResponseWriter, r *http.Request)
PostEnable operation middleware
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