Documentation
¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.3.0 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r *mux.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r *mux.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options GorillaServerOptions) http.Handler
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type CustomServer
- type ErrorMessage
- type ErrorMessageCanBeRetried
- type GetAnything200JSONResponse
- type GetAnything404JSONResponse
- type GetAnythingRequestObject
- type GetAnythingResponseObject
- type GorillaServerOptions
- type InvalidParamFormatError
- type MiddlewareFunc
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- 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, r *mux.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options GorillaServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type CustomServer ¶
func NewCustomServer ¶
func NewCustomServer() *CustomServer
func (*CustomServer) GetAnything ¶
func (cs *CustomServer) GetAnything(ctx context.Context, request GetAnythingRequestObject) (GetAnythingResponseObject, error)
GET /anything
type ErrorMessage ¶
type ErrorMessage struct { CanBeRetried *ErrorMessageCanBeRetried `json:"canBeRetried,omitempty"` DetailedErrorCode *int32 `json:"detailedErrorCode,omitempty"` Error *string `json:"error"` // Inner Detailed error message Inner *ErrorMessage `json:"inner,omitempty"` StatusCode *int32 `json:"statusCode,omitempty"` }
ErrorMessage Detailed error message
type ErrorMessageCanBeRetried ¶
type ErrorMessageCanBeRetried string
ErrorMessageCanBeRetried defines model for ErrorMessage.CanBeRetried.
const ( No ErrorMessageCanBeRetried = "No" Unknown ErrorMessageCanBeRetried = "Unknown" Yes ErrorMessageCanBeRetried = "Yes" )
Defines values for ErrorMessageCanBeRetried.
type GetAnything200JSONResponse ¶
type GetAnything200JSONResponse ErrorMessage
func (GetAnything200JSONResponse) VisitGetAnythingResponse ¶
func (response GetAnything200JSONResponse) VisitGetAnythingResponse(w http.ResponseWriter) error
type GetAnything404JSONResponse ¶
type GetAnything404JSONResponse ErrorMessage
func (GetAnything404JSONResponse) VisitGetAnythingResponse ¶
func (response GetAnything404JSONResponse) VisitGetAnythingResponse(w http.ResponseWriter) error
type GetAnythingRequestObject ¶
type GetAnythingRequestObject struct { }
type GetAnythingResponseObject ¶
type GetAnythingResponseObject interface {
VisitGetAnythingResponse(w http.ResponseWriter) error
}
type GorillaServerOptions ¶
type GorillaServerOptions struct { BaseURL string BaseRouter *mux.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
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 { // Get anything // (GET /anything) GetAnything(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) GetAnything ¶
func (siw *ServerInterfaceWrapper) GetAnything(w http.ResponseWriter, r *http.Request)
GetAnything 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 StrictHandlerFunc = strictnethttp.StrictHTTPHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = strictnethttp.StrictHTTPMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface { // Get anything // (GET /anything) GetAnything(ctx context.Context, request GetAnythingRequestObject) (GetAnythingResponseObject, 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