Documentation
¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version (devel) 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 AddPetJSONRequestBody
- type ChiServerOptions
- type Error
- type FindPetsParams
- type InvalidParamFormatError
- type MiddlewareFunc
- type NewPet
- type Pet
- type PetStore
- func (p *PetStore) AddPet(w http.ResponseWriter, r *http.Request)
- func (p *PetStore) DeletePet(w http.ResponseWriter, r *http.Request, id int64)
- func (p *PetStore) FindPetByID(w http.ResponseWriter, r *http.Request, id int64)
- func (p *PetStore) FindPets(w http.ResponseWriter, r *http.Request, params FindPetsParams)
- 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) FindPets(w http.ResponseWriter, r *http.Request)
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- func (_ Unimplemented) AddPet(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) DeletePet(w http.ResponseWriter, r *http.Request, id int64)
- func (_ Unimplemented) FindPetByID(w http.ResponseWriter, r *http.Request, id int64)
- func (_ Unimplemented) FindPets(w http.ResponseWriter, r *http.Request, params FindPetsParams)
- 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 ¶ added in v1.3.4
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 ¶ added in v1.4.0
func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
func HandlerWithOptions ¶ added in v1.4.2
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 ¶ added in v1.4.2
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 FindPetsParams ¶
type FindPetsParams 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"`
}
FindPetsParams defines parameters for FindPets.
type InvalidParamFormatError ¶ added in v1.9.0
func (*InvalidParamFormatError) Error ¶ added in v1.9.0
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶ added in v1.9.0
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 PetStore ¶
func NewPetStore ¶
func NewPetStore() *PetStore
func (*PetStore) FindPetByID ¶ added in v1.7.1
func (*PetStore) FindPets ¶
func (p *PetStore) FindPets(w http.ResponseWriter, r *http.Request, params FindPetsParams)
FindPets implements all the handlers in the ServerInterface
type RequiredHeaderError ¶ added in v1.9.0
func (*RequiredHeaderError) Error ¶ added in v1.9.0
func (e *RequiredHeaderError) Error() string
func (*RequiredHeaderError) Unwrap ¶ added in v1.9.0
func (e *RequiredHeaderError) Unwrap() error
type RequiredParamError ¶ added in v1.9.0
type RequiredParamError struct {
ParamName string
}
func (*RequiredParamError) Error ¶ added in v1.9.0
func (e *RequiredParamError) Error() string
type ServerInterface ¶
type ServerInterface interface {
// Returns all pets
// (GET /pets)
FindPets(w http.ResponseWriter, r *http.Request, params FindPetsParams)
// 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 ¶ added in v1.3.10
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 ¶ added in v1.3.10
func (siw *ServerInterfaceWrapper) AddPet(w http.ResponseWriter, r *http.Request)
AddPet operation middleware
func (*ServerInterfaceWrapper) DeletePet ¶ added in v1.3.10
func (siw *ServerInterfaceWrapper) DeletePet(w http.ResponseWriter, r *http.Request)
DeletePet operation middleware
func (*ServerInterfaceWrapper) FindPetByID ¶ added in v1.7.0
func (siw *ServerInterfaceWrapper) FindPetByID(w http.ResponseWriter, r *http.Request)
FindPetByID operation middleware
func (*ServerInterfaceWrapper) FindPets ¶ added in v1.3.10
func (siw *ServerInterfaceWrapper) FindPets(w http.ResponseWriter, r *http.Request)
FindPets operation middleware
type TooManyValuesForParamError ¶ added in v1.9.0
func (*TooManyValuesForParamError) Error ¶ added in v1.9.0
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶ added in v1.9.0
func (*UnescapedCookieParamError) Error ¶ added in v1.9.0
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶ added in v1.9.0
func (e *UnescapedCookieParamError) Unwrap() error
type Unimplemented ¶ added in v1.13.1
type Unimplemented struct{}
func (Unimplemented) AddPet ¶ added in v1.13.1
func (_ Unimplemented) AddPet(w http.ResponseWriter, r *http.Request)
Creates a new pet (POST /pets)
func (Unimplemented) DeletePet ¶ added in v1.13.1
func (_ Unimplemented) DeletePet(w http.ResponseWriter, r *http.Request, id int64)
Deletes a pet by ID (DELETE /pets/{id})
func (Unimplemented) FindPetByID ¶ added in v1.13.1
func (_ Unimplemented) FindPetByID(w http.ResponseWriter, r *http.Request, id int64)
Returns a pet by ID (GET /pets/{id})
func (Unimplemented) FindPets ¶ added in v1.13.1
func (_ Unimplemented) FindPets(w http.ResponseWriter, r *http.Request, params FindPetsParams)
Returns all pets (GET /pets)
type UnmarshalingParamError ¶ added in v1.9.0
func (*UnmarshalingParamError) Error ¶ added in v1.9.0
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶ added in v1.9.0
func (e *UnmarshalingParamError) Unwrap() error