Documentation ¶
Overview ¶
Package petstore provides primitives to interact the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT.
Index ¶
- func GetSwagger() (*openapi3.Swagger, error)
- func NewAddPetRequest(server string, body AddPetJSONRequestBody) (*http.Request, error)
- func NewAddPetRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewDeletePetRequest(server string, id int64) (*http.Request, error)
- func NewFindPetByIdRequest(server string, id int64) (*http.Request, error)
- func NewFindPetsRequest(server string, params *FindPetsParams) (*http.Request, error)
- func ParseAddPetResponse(rsp *http.Response) (*addPetResponse, error)
- func ParseDeletePetResponse(rsp *http.Response) (*deletePetResponse, error)
- func ParseFindPetByIdResponse(rsp *http.Response) (*findPetByIdResponse, error)
- func ParseFindPetsResponse(rsp *http.Response) (*findPetsResponse, error)
- func RegisterHandlers(router interface{ ... }, si ServerInterface)
- type AddPetJSONBody
- type AddPetJSONRequestBody
- type Client
- func (c *Client) AddPet(ctx context.Context, body AddPetJSONRequestBody) (*http.Response, error)
- func (c *Client) AddPetWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error)
- func (c *Client) DeletePet(ctx context.Context, id int64) (*http.Response, error)
- func (c *Client) FindPetById(ctx context.Context, id int64) (*http.Response, error)
- func (c *Client) FindPets(ctx context.Context, params *FindPetsParams) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) AddPetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*addPetResponse, error)
- func (c *ClientWithResponses) AddPetWithResponse(ctx context.Context, body AddPetJSONRequestBody) (*addPetResponse, error)
- func (c *ClientWithResponses) DeletePetWithResponse(ctx context.Context, id int64) (*deletePetResponse, error)
- func (c *ClientWithResponses) FindPetByIdWithResponse(ctx context.Context, id int64) (*findPetByIdResponse, error)
- func (c *ClientWithResponses) FindPetsWithResponse(ctx context.Context, params *FindPetsParams) (*findPetsResponse, error)
- type Error
- type FindPetsParams
- type HttpRequestDoer
- type NewPet
- type Pet
- type RequestEditorFn
- type ServerInterface
- type ServerInterfaceWrapper
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.
func NewAddPetRequest ¶
func NewAddPetRequest(server string, body AddPetJSONRequestBody) (*http.Request, error)
NewAddPetRequest calls the generic AddPet builder with application/json body
func NewAddPetRequestWithBody ¶
func NewAddPetRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewAddPetRequestWithBody generates requests for AddPet with any type of body
func NewDeletePetRequest ¶
NewDeletePetRequest generates requests for DeletePet
func NewFindPetByIdRequest ¶
NewFindPetByIdRequest generates requests for FindPetById
func NewFindPetsRequest ¶
func NewFindPetsRequest(server string, params *FindPetsParams) (*http.Request, error)
NewFindPetsRequest generates requests for FindPets
func ParseAddPetResponse ¶
ParseAddPetResponse parses an HTTP response from a AddPetWithResponse call
func ParseDeletePetResponse ¶
ParseDeletePetResponse parses an HTTP response from a DeletePetWithResponse call
func ParseFindPetByIdResponse ¶
ParseFindPetByIdResponse parses an HTTP response from a FindPetByIdWithResponse call
func ParseFindPetsResponse ¶
ParseFindPetsResponse parses an HTTP response from a FindPetsWithResponse call
func RegisterHandlers ¶
func RegisterHandlers(router interface { CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route }, si ServerInterface)
RegisterHandlers adds each server route to the EchoRouter.
Types ¶
type AddPetJSONRequestBody ¶
type AddPetJSONRequestBody AddPetJSONBody
AddPetRequestBody defines body for AddPet for application/json ContentType.
type Client ¶
type Client struct { // The endpoint of the server conforming to this interface, with scheme, // https://api.deepmap.com for example. Server string // Doer for performing requests, typically a *http.Client with any // customized settings, such as certificate chains. Client HttpRequestDoer // A callback for modifying requests which are generated before sending over // the network. RequestEditor RequestEditorFn }
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) AddPetWithBody ¶
func (*Client) FindPetById ¶
type ClientInterface ¶
type ClientInterface interface { // FindPets request FindPets(ctx context.Context, params *FindPetsParams) (*http.Response, error) // AddPet request with any body AddPetWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) AddPet(ctx context.Context, body AddPetJSONRequestBody) (*http.Response, error) // DeletePet request DeletePet(ctx context.Context, id int64) (*http.Response, error) // FindPetById request FindPetById(ctx context.Context, id int64) (*http.Response, error) }
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) AddPetWithBodyWithResponse ¶
func (c *ClientWithResponses) AddPetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*addPetResponse, error)
AddPetWithBodyWithResponse request with arbitrary body returning *AddPetResponse
func (*ClientWithResponses) AddPetWithResponse ¶
func (c *ClientWithResponses) AddPetWithResponse(ctx context.Context, body AddPetJSONRequestBody) (*addPetResponse, error)
func (*ClientWithResponses) DeletePetWithResponse ¶
func (c *ClientWithResponses) DeletePetWithResponse(ctx context.Context, id int64) (*deletePetResponse, error)
DeletePetWithResponse request returning *DeletePetResponse
func (*ClientWithResponses) FindPetByIdWithResponse ¶
func (c *ClientWithResponses) FindPetByIdWithResponse(ctx context.Context, id int64) (*findPetByIdResponse, error)
FindPetByIdWithResponse request returning *FindPetByIdResponse
func (*ClientWithResponses) FindPetsWithResponse ¶
func (c *ClientWithResponses) FindPetsWithResponse(ctx context.Context, params *FindPetsParams) (*findPetsResponse, error)
FindPetsWithResponse request returning *FindPetsResponse
type FindPetsParams ¶
type FindPetsParams struct { // tags to filter by Tags *[]string `json:"tags,omitempty"` // maximum number of results to return Limit *int32 `json:"limit,omitempty"` }
FindPetsParams defines parameters for FindPets.
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type Pet ¶
type Pet struct { // Embedded struct due to allOf(#/components/schemas/NewPet) NewPet // Embedded fields due to inline allOf schema Id int64 `json:"id"` }
Pet defines model for Pet.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type ServerInterface ¶
type ServerInterface interface { // (GET /pets) FindPets(ctx echo.Context, params FindPetsParams) error // (POST /pets) AddPet(ctx echo.Context) error // (DELETE /pets/{id}) DeletePet(ctx echo.Context, id int64) error // (GET /pets/{id}) FindPetById(ctx echo.Context, id int64) error }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) AddPet ¶
func (w *ServerInterfaceWrapper) AddPet(ctx echo.Context) error
AddPet converts echo context to params.
func (*ServerInterfaceWrapper) DeletePet ¶
func (w *ServerInterfaceWrapper) DeletePet(ctx echo.Context) error
DeletePet converts echo context to params.
func (*ServerInterfaceWrapper) FindPetById ¶
func (w *ServerInterfaceWrapper) FindPetById(ctx echo.Context) error
FindPetById converts echo context to params.
func (*ServerInterfaceWrapper) FindPets ¶
func (w *ServerInterfaceWrapper) FindPets(ctx echo.Context) error
FindPets converts echo context to params.