Documentation
¶
Overview ¶
Package oapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.
Package oapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.
Package oapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.
Index ¶
- Constants
- func GetSwagger() (swagger *openapi3.T, err error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type CreatePetsJSONRequestBody
- type EchoRouter
- type Error
- type ListPetsParams
- type Pet
- type Pets
- type ServerInterface
- type ServerInterfaceWrapper
- func (w *ServerInterfaceWrapper) CreatePets(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) DeleteSession(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetSession(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) ListPets(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) Redirect(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) ShowPetById(ctx echo.Context) error
Constants ¶
const ( BearerAuthScopes = "bearerAuth.Scopes" CookieAuthScopes = "cookieAuth.Scopes" )
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 EchoRouter, si ServerInterface)
RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlersWithBaseURL ¶
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.
Types ¶
type CreatePetsJSONRequestBody ¶
type CreatePetsJSONRequestBody = Pet
CreatePetsJSONRequestBody defines body for CreatePets for application/json ContentType.
type EchoRouter ¶
type EchoRouter 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 }
This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration
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 Pet ¶
type Pet struct { Id int64 `json:"id"` Name string `json:"name"` Tag *string `json:"tag,omitempty"` }
Pet defines model for Pet.
type ServerInterface ¶
type ServerInterface interface { // List all pets // (GET /pets) ListPets(ctx echo.Context, params ListPetsParams) error // Create a pet // (POST /pets) CreatePets(ctx echo.Context) error // Info for a specific pet // (GET /pets/{pet_id}) ShowPetById(ctx echo.Context, petId string) error // Redirect // (GET /redirect) Redirect(ctx echo.Context) error // Delete session // (DELETE /session) DeleteSession(ctx echo.Context) error // Get session // (GET /session) GetSession(ctx echo.Context) error }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) CreatePets ¶
func (w *ServerInterfaceWrapper) CreatePets(ctx echo.Context) error
CreatePets converts echo context to params.
func (*ServerInterfaceWrapper) DeleteSession ¶
func (w *ServerInterfaceWrapper) DeleteSession(ctx echo.Context) error
DeleteSession converts echo context to params.
func (*ServerInterfaceWrapper) GetSession ¶
func (w *ServerInterfaceWrapper) GetSession(ctx echo.Context) error
GetSession converts echo context to params.
func (*ServerInterfaceWrapper) ListPets ¶
func (w *ServerInterfaceWrapper) ListPets(ctx echo.Context) error
ListPets converts echo context to params.
func (*ServerInterfaceWrapper) Redirect ¶
func (w *ServerInterfaceWrapper) Redirect(ctx echo.Context) error
Redirect converts echo context to params.
func (*ServerInterfaceWrapper) ShowPetById ¶
func (w *ServerInterfaceWrapper) ShowPetById(ctx echo.Context) error
ShowPetById converts echo context to params.