Documentation ¶
Overview ¶
Package petapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.
Package petapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.
Package petapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.4 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 Error
- type InvalidParamFormatError
- type ListPetsParams
- type MiddlewareFunc
- type Pet
- type Pets
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) CreatePets(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListPets(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ShowPetById(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) SwaggerDoc(w http.ResponseWriter, r *http.Request)
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshallingParamError
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 InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type ListPetsParams ¶
type ListPetsParams struct { // Limit How many items to return at one time (max 100) Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"` }
ListPetsParams defines parameters for ListPets.
type Pet ¶
type Pet struct { Id int64 `json:"id"` Name string `json:"name"` Tag *string `json:"tag,omitempty"` }
Pet defines model for Pet.
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 { // swagger doc // (GET /doc) SwaggerDoc(w http.ResponseWriter, r *http.Request) // List all pets // (GET /pets) ListPets(w http.ResponseWriter, r *http.Request, params ListPetsParams) // Create a pet // (POST /pets) CreatePets(w http.ResponseWriter, r *http.Request) // Info for a specific pet // (GET /pets/{petId}) ShowPetById(w http.ResponseWriter, r *http.Request, petId 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) CreatePets ¶
func (siw *ServerInterfaceWrapper) CreatePets(w http.ResponseWriter, r *http.Request)
CreatePets operation middleware
func (*ServerInterfaceWrapper) ListPets ¶
func (siw *ServerInterfaceWrapper) ListPets(w http.ResponseWriter, r *http.Request)
ListPets operation middleware
func (*ServerInterfaceWrapper) ShowPetById ¶
func (siw *ServerInterfaceWrapper) ShowPetById(w http.ResponseWriter, r *http.Request)
ShowPetById operation middleware
func (*ServerInterfaceWrapper) SwaggerDoc ¶
func (siw *ServerInterfaceWrapper) SwaggerDoc(w http.ResponseWriter, r *http.Request)
SwaggerDoc 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 UnmarshallingParamError ¶
func (*UnmarshallingParamError) Error ¶
func (e *UnmarshallingParamError) Error() string
func (*UnmarshallingParamError) Unwrap ¶
func (e *UnmarshallingParamError) Unwrap() error