Documentation ¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.11.0 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 New(cfg *config.Config) *http.Server
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type ChiServerOptions
- type CreateOrder
- type DeleteOrderOrderIDItemJSONBody
- type DeleteOrderOrderIDItemJSONRequestBody
- type Error
- type HandlerDecorator
- type InvalidParamFormatError
- type Item
- type MiddlewareFunc
- type Option
- type Order
- type PutOrderOrderIDJSONBody
- type PutOrderOrderIDJSONRequestBody
- type RequiredHeaderError
- type RequiredParamError
- type RestController
- func (RestController) DeleteOrderOrderIDItem(w http.ResponseWriter, r *http.Request, orderID openapi_types.UUID, ...)
- func (RestController) PostOrder(w http.ResponseWriter, r *http.Request)
- func (RestController) PostOrderOrderID(w http.ResponseWriter, r *http.Request, orderID openapi_types.UUID)
- func (RestController) PutOrderOrderID(w http.ResponseWriter, r *http.Request, orderID openapi_types.UUID)
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) DeleteOrderOrderIDItem(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostOrder(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PostOrderOrderID(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PutOrderOrderID(w http.ResponseWriter, r *http.Request)
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshalingParamError
- type Validated
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 CreateOrder ¶
type CreateOrder struct {
CustomerId *openapi_types.UUID `json:"customer_id,omitempty"`
}
CreateOrder defines model for CreateOrder.
func (*CreateOrder) Validate ¶
func (r *CreateOrder) Validate() error
type DeleteOrderOrderIDItemJSONBody ¶
type DeleteOrderOrderIDItemJSONBody = Item
DeleteOrderOrderIDItemJSONBody defines parameters for DeleteOrderOrderIDItem.
type DeleteOrderOrderIDItemJSONRequestBody ¶
type DeleteOrderOrderIDItemJSONRequestBody = DeleteOrderOrderIDItemJSONBody
DeleteOrderOrderIDItemJSONRequestBody defines body for DeleteOrderOrderIDItem for application/json ContentType.
type Error ¶
type Error struct {
Errors *[]string `json:"errors,omitempty"`
}
Error defines model for Error.
type HandlerDecorator ¶
type HandlerDecorator struct {
// contains filtered or unexported fields
}
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 Option ¶
type Option func(*HandlerDecorator)
func WithDefaultStatus ¶
func WithErrorMapper ¶
func WithRequestBody ¶
func WithResponseMapper ¶
type Order ¶
type Order struct { CustomerId *openapi_types.UUID `json:"customer_id,omitempty"` Id *openapi_types.UUID `json:"id,omitempty"` Items *[]string `json:"items,omitempty"` PaymentId *openapi_types.UUID `json:"payment_id,omitempty"` }
Order defines model for Order.
type PutOrderOrderIDJSONBody ¶
type PutOrderOrderIDJSONBody = Item
PutOrderOrderIDJSONBody defines parameters for PutOrderOrderID.
type PutOrderOrderIDJSONRequestBody ¶
type PutOrderOrderIDJSONRequestBody = PutOrderOrderIDJSONBody
PutOrderOrderIDJSONRequestBody defines body for PutOrderOrderID 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 RestController ¶
type RestController struct{}
func (RestController) DeleteOrderOrderIDItem ¶
func (RestController) DeleteOrderOrderIDItem(w http.ResponseWriter, r *http.Request, orderID openapi_types.UUID, item string)
func (RestController) PostOrder ¶
func (RestController) PostOrder(w http.ResponseWriter, r *http.Request)
func (RestController) PostOrderOrderID ¶
func (RestController) PostOrderOrderID(w http.ResponseWriter, r *http.Request, orderID openapi_types.UUID)
func (RestController) PutOrderOrderID ¶
func (RestController) PutOrderOrderID(w http.ResponseWriter, r *http.Request, orderID openapi_types.UUID)
type ServerInterface ¶
type ServerInterface interface { // Create new order // (POST /order) PostOrder(w http.ResponseWriter, r *http.Request) // close order and send to process payments // (POST /order/{orderID}) PostOrderOrderID(w http.ResponseWriter, r *http.Request, orderID openapi_types.UUID) // Add item to order // (PUT /order/{orderID}) PutOrderOrderID(w http.ResponseWriter, r *http.Request, orderID openapi_types.UUID) // Remove item from order // (DELETE /order/{orderID}/{item}) DeleteOrderOrderIDItem(w http.ResponseWriter, r *http.Request, orderID openapi_types.UUID, item string) }
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) DeleteOrderOrderIDItem ¶
func (siw *ServerInterfaceWrapper) DeleteOrderOrderIDItem(w http.ResponseWriter, r *http.Request)
DeleteOrderOrderIDItem operation middleware
func (*ServerInterfaceWrapper) PostOrder ¶
func (siw *ServerInterfaceWrapper) PostOrder(w http.ResponseWriter, r *http.Request)
PostOrder operation middleware
func (*ServerInterfaceWrapper) PostOrderOrderID ¶
func (siw *ServerInterfaceWrapper) PostOrderOrderID(w http.ResponseWriter, r *http.Request)
PostOrderOrderID operation middleware
func (*ServerInterfaceWrapper) PutOrderOrderID ¶
func (siw *ServerInterfaceWrapper) PutOrderOrderID(w http.ResponseWriter, r *http.Request)
PutOrderOrderID 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