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.4.1 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 ChiServerOptions
- type CreatePets201Response
- type CreatePetsJSONRequestBody
- type CreatePetsRequestObject
- type CreatePetsResponseObject
- type CreatePetsdefaultJSONResponse
- type Error
- type InvalidParamFormatError
- type ListPets200JSONResponse
- type ListPets200ResponseHeaders
- type ListPetsParams
- type ListPetsRequestObject
- type ListPetsResponseObject
- type ListPetsdefaultJSONResponse
- type MiddlewareFunc
- type Pet
- type Pets
- type RequiredHeaderError
- type RequiredParamError
- type Server
- func (s *Server) CreatePets(ctx context.Context, req CreatePetsRequestObject) (CreatePetsResponseObject, error)
- func (s *Server) ListPets(ctx context.Context, req ListPetsRequestObject) (ListPetsResponseObject, error)
- func (s *Server) ShowPetById(ctx context.Context, req ShowPetByIdRequestObject) (ShowPetByIdResponseObject, error)
- type ServerInterface
- type ServerInterfaceWrapper
- type ShowPetById200JSONResponse
- type ShowPetByIdRequestObject
- type ShowPetByIdResponseObject
- type ShowPetByIddefaultJSONResponse
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- type UnmarshalingParamError
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 ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type CreatePets201Response ¶
type CreatePets201Response struct { }
func (CreatePets201Response) VisitCreatePetsResponse ¶
func (response CreatePets201Response) VisitCreatePetsResponse(w http.ResponseWriter) error
type CreatePetsJSONRequestBody ¶
type CreatePetsJSONRequestBody = Pet
CreatePetsJSONRequestBody defines body for CreatePets for application/json ContentType.
type CreatePetsRequestObject ¶
type CreatePetsRequestObject struct {
Body *CreatePetsJSONRequestBody
}
type CreatePetsResponseObject ¶
type CreatePetsResponseObject interface {
VisitCreatePetsResponse(w http.ResponseWriter) error
}
type CreatePetsdefaultJSONResponse ¶
func (CreatePetsdefaultJSONResponse) VisitCreatePetsResponse ¶
func (response CreatePetsdefaultJSONResponse) VisitCreatePetsResponse(w http.ResponseWriter) error
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type ListPets200JSONResponse ¶
type ListPets200JSONResponse struct { Body Pets Headers ListPets200ResponseHeaders }
func (ListPets200JSONResponse) VisitListPetsResponse ¶
func (response ListPets200JSONResponse) VisitListPetsResponse(w http.ResponseWriter) error
type ListPets200ResponseHeaders ¶
type ListPets200ResponseHeaders struct {
XNext string
}
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 ListPetsRequestObject ¶
type ListPetsRequestObject struct {
Params ListPetsParams
}
type ListPetsResponseObject ¶
type ListPetsResponseObject interface {
VisitListPetsResponse(w http.ResponseWriter) error
}
type ListPetsdefaultJSONResponse ¶
func (ListPetsdefaultJSONResponse) VisitListPetsResponse ¶
func (response ListPetsdefaultJSONResponse) VisitListPetsResponse(w http.ResponseWriter) error
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 Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) CreatePets ¶
func (s *Server) CreatePets(ctx context.Context, req CreatePetsRequestObject) (CreatePetsResponseObject, error)
(POST /pets)
func (*Server) ListPets ¶
func (s *Server) ListPets(ctx context.Context, req ListPetsRequestObject) (ListPetsResponseObject, error)
(GET /pets)
func (*Server) ShowPetById ¶
func (s *Server) ShowPetById(ctx context.Context, req ShowPetByIdRequestObject) (ShowPetByIdResponseObject, error)
(GET /pets/{petId})
type ServerInterface ¶
type ServerInterface interface { // 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.
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) 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
type ShowPetById200JSONResponse ¶
type ShowPetById200JSONResponse Pet
func (ShowPetById200JSONResponse) VisitShowPetByIdResponse ¶
func (response ShowPetById200JSONResponse) VisitShowPetByIdResponse(w http.ResponseWriter) error
type ShowPetByIdRequestObject ¶
type ShowPetByIdRequestObject struct {
PetId string `json:"petId"`
}
type ShowPetByIdResponseObject ¶
type ShowPetByIdResponseObject interface {
VisitShowPetByIdResponse(w http.ResponseWriter) error
}
type ShowPetByIddefaultJSONResponse ¶
func (ShowPetByIddefaultJSONResponse) VisitShowPetByIdResponse ¶
func (response ShowPetByIddefaultJSONResponse) VisitShowPetByIdResponse(w http.ResponseWriter) error
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 { // List all pets // (GET /pets) ListPets(ctx context.Context, request ListPetsRequestObject) (ListPetsResponseObject, error) // Create a pet // (POST /pets) CreatePets(ctx context.Context, request CreatePetsRequestObject) (CreatePetsResponseObject, error) // Info for a specific pet // (GET /pets/{petId}) ShowPetById(ctx context.Context, request ShowPetByIdRequestObject) (ShowPetByIdResponseObject, 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 Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) CreatePets ¶
func (_ Unimplemented) CreatePets(w http.ResponseWriter, r *http.Request)
Create a pet (POST /pets)
func (Unimplemented) ListPets ¶
func (_ Unimplemented) ListPets(w http.ResponseWriter, r *http.Request, params ListPetsParams)
List all pets (GET /pets)
func (Unimplemented) ShowPetById ¶
func (_ Unimplemented) ShowPetById(w http.ResponseWriter, r *http.Request, petId string)
Info for a specific pet (GET /pets/{petId})
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error