Documentation ¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by bitbucket.org/tin_gimranoff/oapi-codegen version (devel) DO NOT EDIT.
Package api provides primitives to interact with the openapi HTTP API.
Code generated by bitbucket.org/tin_gimranoff/oapi-codegen version (devel) DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router fiber.Router, si ServerInterface)
- func RegisterHandlersWithOptions(router fiber.Router, si ServerInterface, options FiberServerOptions)
- type AddPetJSONRequestBody
- type Error
- type FiberServerOptions
- type FindPetsParams
- type MiddlewareFunc
- type NewPet
- type Pet
- type PetStore
- 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. 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 PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func RegisterHandlers ¶
func RegisterHandlers(router fiber.Router, si ServerInterface)
RegisterHandlers creates http.Handler with routing matching OpenAPI spec.
func RegisterHandlersWithOptions ¶
func RegisterHandlersWithOptions(router fiber.Router, si ServerInterface, options FiberServerOptions)
RegisterHandlersWithOptions creates http.Handler with additional options
Types ¶
type AddPetJSONRequestBody ¶
type AddPetJSONRequestBody = NewPet
AddPetJSONRequestBody defines body for AddPet for application/json ContentType.
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 FiberServerOptions ¶
type FiberServerOptions struct { BaseURL string Middlewares []MiddlewareFunc }
FiberServerOptions provides options for the Fiber server.
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 MiddlewareFunc ¶
type MiddlewareFunc fiber.Handler
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 ¶
func (*PetStore) FindPets ¶
func (p *PetStore) FindPets(c *fiber.Ctx, params FindPetsParams) error
FindPets implements all the handlers in the ServerInterface
type ServerInterface ¶
type ServerInterface interface { // Returns all pets // (GET /pets) FindPets(c *fiber.Ctx, params FindPetsParams) error // Creates a new pet // (POST /pets) AddPet(c *fiber.Ctx) error // Deletes a pet by ID // (DELETE /pets/{id}) DeletePet(c *fiber.Ctx, id int64) error // Returns a pet by ID // (GET /pets/{id}) FindPetByID(c *fiber.Ctx, id int64) error }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) AddPet ¶
func (siw *ServerInterfaceWrapper) AddPet(c *fiber.Ctx) error
AddPet operation middleware
func (*ServerInterfaceWrapper) DeletePet ¶
func (siw *ServerInterfaceWrapper) DeletePet(c *fiber.Ctx) error
DeletePet operation middleware
func (*ServerInterfaceWrapper) FindPetByID ¶
func (siw *ServerInterfaceWrapper) FindPetByID(c *fiber.Ctx) error
FindPetByID operation middleware
func (*ServerInterfaceWrapper) FindPets ¶
func (siw *ServerInterfaceWrapper) FindPets(c *fiber.Ctx) error
FindPets operation middleware