Documentation ¶
Overview ¶
Package petstore 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 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
- type AddPetJSONRequestBody
- type ChiServerOptions
- type Error
- type GetPetsParams
- type InvalidParamFormatError
- type MiddlewareFunc
- type NewPet
- type Pet
- type PetStoreHandler
- func (p *PetStoreHandler) AddPet(w http.ResponseWriter, r *http.Request)
- func (p *PetStoreHandler) DeletePet(w http.ResponseWriter, r *http.Request, id int64)
- func (p *PetStoreHandler) FindPetByID(w http.ResponseWriter, r *http.Request, id int64)
- func (p *PetStoreHandler) GetPets(w http.ResponseWriter, r *http.Request, params GetPetsParams)
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) AddPet(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeletePet(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) FindPetByID(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetPets(w http.ResponseWriter, r *http.Request)
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshallingParamError
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 AddPetJSONRequestBody ¶
type AddPetJSONRequestBody = NewPet
AddPetJSONRequestBody defines body for AddPet for application/json ContentType.
type ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type Error ¶
type Error struct { // Code Error code Code int32 `json:"code"` // Message Error message Message string `json:"message"` }
Error defines model for Error.
type GetPetsParams ¶
type GetPetsParams struct { // Tags tags to filter by Tags *[]string `form:"tags,omitempty" json:"tags,omitempty"` // Limit maximum number of results to return Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"` }
GetPetsParams defines parameters for GetPets.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type NewPet ¶
type NewPet struct { // Name Name of the pet Name string `json:"name"` // Tag Type of the pet Tag *string `json:"tag,omitempty"` }
NewPet defines model for NewPet.
type Pet ¶
type Pet struct { // Id Unique id of the pet Id int64 `json:"id"` // Name Name of the pet Name string `json:"name"` // Tag Type of the pet Tag *string `json:"tag,omitempty"` }
Pet defines model for Pet.
type PetStoreHandler ¶
type PetStoreHandler struct { NextId int64 Lock sync.Mutex // contains filtered or unexported fields }
func NewPetStoreHandler ¶
func NewPetStoreHandler(db *gorm.DB) *PetStoreHandler
func (*PetStoreHandler) AddPet ¶
func (p *PetStoreHandler) AddPet(w http.ResponseWriter, r *http.Request)
func (*PetStoreHandler) DeletePet ¶
func (p *PetStoreHandler) DeletePet(w http.ResponseWriter, r *http.Request, id int64)
func (*PetStoreHandler) FindPetByID ¶
func (p *PetStoreHandler) FindPetByID(w http.ResponseWriter, r *http.Request, id int64)
func (*PetStoreHandler) GetPets ¶
func (p *PetStoreHandler) GetPets(w http.ResponseWriter, r *http.Request, params GetPetsParams)
GetPets implements all the handlers in the ServerInterface
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 { // Returns all pets // (GET /pets) GetPets(w http.ResponseWriter, r *http.Request, params GetPetsParams) // Creates a new pet // (POST /pets) AddPet(w http.ResponseWriter, r *http.Request) // Deletes a pet by ID // (DELETE /pets/{id}) DeletePet(w http.ResponseWriter, r *http.Request, id int64) // Returns a pet by ID // (GET /pets/{id}) FindPetByID(w http.ResponseWriter, r *http.Request, id int64) }
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) AddPet ¶
func (siw *ServerInterfaceWrapper) AddPet(w http.ResponseWriter, r *http.Request)
AddPet operation middleware
func (*ServerInterfaceWrapper) DeletePet ¶
func (siw *ServerInterfaceWrapper) DeletePet(w http.ResponseWriter, r *http.Request)
DeletePet operation middleware
func (*ServerInterfaceWrapper) FindPetByID ¶
func (siw *ServerInterfaceWrapper) FindPetByID(w http.ResponseWriter, r *http.Request)
FindPetByID operation middleware
func (*ServerInterfaceWrapper) GetPets ¶
func (siw *ServerInterfaceWrapper) GetPets(w http.ResponseWriter, r *http.Request)
GetPets 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