Documentation ¶
Overview ¶
Package gen provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0 DO NOT EDIT.
Index ¶
- 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 CreateUser
- type CreateUserJSONRequestBody
- type EchoRouter
- type ErrorResponse
- type SearchVoucherParams
- type ServerInterface
- type ServerInterfaceWrapper
- type User
- type Voucher
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 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 CreateUser ¶
type CreateUser struct {
Name string `json:"name"`
}
CreateUser defines model for CreateUser.
type CreateUserJSONRequestBody ¶
type CreateUserJSONRequestBody = CreateUser
CreateUserJSONRequestBody defines body for CreateUser 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 ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
ErrorResponse defines model for ErrorResponse.
type SearchVoucherParams ¶
type SearchVoucherParams struct { // UserId User ID UserId int64 `form:"userId" json:"userId"` }
SearchVoucherParams defines parameters for SearchVoucher.
type ServerInterface ¶
type ServerInterface interface { // Create voucher // (POST /v1/users) CreateUser(ctx echo.Context) error // Get voucher by id // (GET /v1/users/{id}) GetUserById(ctx echo.Context, id int64) error // Search voucher // (GET /v1/vouchers) SearchVoucher(ctx echo.Context, params SearchVoucherParams) error }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) CreateUser ¶
func (w *ServerInterfaceWrapper) CreateUser(ctx echo.Context) error
CreateUser converts echo context to params.
func (*ServerInterfaceWrapper) GetUserById ¶
func (w *ServerInterfaceWrapper) GetUserById(ctx echo.Context) error
GetUserById converts echo context to params.
func (*ServerInterfaceWrapper) SearchVoucher ¶
func (w *ServerInterfaceWrapper) SearchVoucher(ctx echo.Context) error
SearchVoucher converts echo context to params.