Documentation
¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.16.3 DO NOT EDIT.
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.16.3 DO NOT EDIT.
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.16.3 DO NOT EDIT.
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.16.3 DO NOT EDIT.
Index ¶
- Constants
- func GetSwagger() (swagger *openapi3.T, err error)
- func NewGetPvzRequest(server string, params *GetPvzParams) (*http.Request, error)
- func NewPostDummyLoginRequest(server string, body PostDummyLoginJSONRequestBody) (*http.Request, error)
- func NewPostDummyLoginRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewPostLoginRequest(server string, body PostLoginJSONRequestBody) (*http.Request, error)
- func NewPostLoginRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewPostProductsRequest(server string, body PostProductsJSONRequestBody) (*http.Request, error)
- func NewPostProductsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewPostPvzPvzIdCloseLastReceptionRequest(server string, pvzId openapi_types.UUID) (*http.Request, error)
- func NewPostPvzPvzIdDeleteLastProductRequest(server string, pvzId openapi_types.UUID) (*http.Request, error)
- func NewPostPvzRequest(server string, body PostPvzJSONRequestBody) (*http.Request, error)
- func NewPostPvzRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewPostReceptionsRequest(server string, body PostReceptionsJSONRequestBody) (*http.Request, error)
- func NewPostReceptionsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewPostRegisterRequest(server string, body PostRegisterJSONRequestBody) (*http.Request, error)
- func NewPostRegisterRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, 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 Client
- func (c *Client) GetPvz(ctx context.Context, params *GetPvzParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) PostDummyLogin(ctx context.Context, body PostDummyLoginJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostDummyLoginWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PostLogin(ctx context.Context, body PostLoginJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostLoginWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PostProducts(ctx context.Context, body PostProductsJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostProductsWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PostPvz(ctx context.Context, body PostPvzJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostPvzPvzIdCloseLastReception(ctx context.Context, pvzId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) PostPvzPvzIdDeleteLastProduct(ctx context.Context, pvzId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) PostPvzWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PostReceptions(ctx context.Context, body PostReceptionsJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostReceptionsWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PostRegister(ctx context.Context, body PostRegisterJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostRegisterWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) GetPvzWithResponse(ctx context.Context, params *GetPvzParams, reqEditors ...RequestEditorFn) (*GetPvzResponse, error)
- func (c *ClientWithResponses) PostDummyLoginWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PostDummyLoginResponse, error)
- func (c *ClientWithResponses) PostDummyLoginWithResponse(ctx context.Context, body PostDummyLoginJSONRequestBody, ...) (*PostDummyLoginResponse, error)
- func (c *ClientWithResponses) PostLoginWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PostLoginResponse, error)
- func (c *ClientWithResponses) PostLoginWithResponse(ctx context.Context, body PostLoginJSONRequestBody, ...) (*PostLoginResponse, error)
- func (c *ClientWithResponses) PostProductsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PostProductsResponse, error)
- func (c *ClientWithResponses) PostProductsWithResponse(ctx context.Context, body PostProductsJSONRequestBody, ...) (*PostProductsResponse, error)
- func (c *ClientWithResponses) PostPvzPvzIdCloseLastReceptionWithResponse(ctx context.Context, pvzId openapi_types.UUID, reqEditors ...RequestEditorFn) (*PostPvzPvzIdCloseLastReceptionResponse, error)
- func (c *ClientWithResponses) PostPvzPvzIdDeleteLastProductWithResponse(ctx context.Context, pvzId openapi_types.UUID, reqEditors ...RequestEditorFn) (*PostPvzPvzIdDeleteLastProductResponse, error)
- func (c *ClientWithResponses) PostPvzWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PostPvzResponse, error)
- func (c *ClientWithResponses) PostPvzWithResponse(ctx context.Context, body PostPvzJSONRequestBody, ...) (*PostPvzResponse, error)
- func (c *ClientWithResponses) PostReceptionsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PostReceptionsResponse, error)
- func (c *ClientWithResponses) PostReceptionsWithResponse(ctx context.Context, body PostReceptionsJSONRequestBody, ...) (*PostReceptionsResponse, error)
- func (c *ClientWithResponses) PostRegisterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PostRegisterResponse, error)
- func (c *ClientWithResponses) PostRegisterWithResponse(ctx context.Context, body PostRegisterJSONRequestBody, ...) (*PostRegisterResponse, error)
- type ClientWithResponsesInterface
- type EchoRouter
- type Error
- type GetPvzParams
- type GetPvzResponse
- type HttpRequestDoer
- type PVZ
- type PVZCity
- type PostDummyLoginJSONBody
- type PostDummyLoginJSONBodyRole
- type PostDummyLoginJSONRequestBody
- type PostDummyLoginResponse
- type PostLoginJSONBody
- type PostLoginJSONRequestBody
- type PostLoginResponse
- type PostProductsJSONBody
- type PostProductsJSONBodyType
- type PostProductsJSONRequestBody
- type PostProductsResponse
- type PostPvzJSONRequestBody
- type PostPvzPvzIdCloseLastReceptionResponse
- type PostPvzPvzIdDeleteLastProductResponse
- type PostPvzResponse
- type PostReceptionsJSONBody
- type PostReceptionsJSONRequestBody
- type PostReceptionsResponse
- type PostRegisterJSONBody
- type PostRegisterJSONBodyRole
- type PostRegisterJSONRequestBody
- type PostRegisterResponse
- type Product
- type ProductType
- type Reception
- type ReceptionStatus
- type RequestEditorFn
- type ServerInterface
- type ServerInterfaceWrapper
- func (w *ServerInterfaceWrapper) GetPvz(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostDummyLogin(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostLogin(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostProducts(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostPvz(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostPvzPvzIdCloseLastReception(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostPvzPvzIdDeleteLastProduct(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostReceptions(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostRegister(ctx echo.Context) error
- type Token
- type User
- type UserRole
Constants ¶
const (
BearerAuthScopes = "bearerAuth.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 NewGetPvzRequest ¶
func NewGetPvzRequest(server string, params *GetPvzParams) (*http.Request, error)
NewGetPvzRequest generates requests for GetPvz
func NewPostDummyLoginRequest ¶
func NewPostDummyLoginRequest(server string, body PostDummyLoginJSONRequestBody) (*http.Request, error)
NewPostDummyLoginRequest calls the generic PostDummyLogin builder with application/json body
func NewPostDummyLoginRequestWithBody ¶
func NewPostDummyLoginRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPostDummyLoginRequestWithBody generates requests for PostDummyLogin with any type of body
func NewPostLoginRequest ¶
func NewPostLoginRequest(server string, body PostLoginJSONRequestBody) (*http.Request, error)
NewPostLoginRequest calls the generic PostLogin builder with application/json body
func NewPostLoginRequestWithBody ¶
func NewPostLoginRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPostLoginRequestWithBody generates requests for PostLogin with any type of body
func NewPostProductsRequest ¶
func NewPostProductsRequest(server string, body PostProductsJSONRequestBody) (*http.Request, error)
NewPostProductsRequest calls the generic PostProducts builder with application/json body
func NewPostProductsRequestWithBody ¶
func NewPostProductsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPostProductsRequestWithBody generates requests for PostProducts with any type of body
func NewPostPvzPvzIdCloseLastReceptionRequest ¶
func NewPostPvzPvzIdCloseLastReceptionRequest(server string, pvzId openapi_types.UUID) (*http.Request, error)
NewPostPvzPvzIdCloseLastReceptionRequest generates requests for PostPvzPvzIdCloseLastReception
func NewPostPvzPvzIdDeleteLastProductRequest ¶
func NewPostPvzPvzIdDeleteLastProductRequest(server string, pvzId openapi_types.UUID) (*http.Request, error)
NewPostPvzPvzIdDeleteLastProductRequest generates requests for PostPvzPvzIdDeleteLastProduct
func NewPostPvzRequest ¶
func NewPostPvzRequest(server string, body PostPvzJSONRequestBody) (*http.Request, error)
NewPostPvzRequest calls the generic PostPvz builder with application/json body
func NewPostPvzRequestWithBody ¶
func NewPostPvzRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPostPvzRequestWithBody generates requests for PostPvz with any type of body
func NewPostReceptionsRequest ¶
func NewPostReceptionsRequest(server string, body PostReceptionsJSONRequestBody) (*http.Request, error)
NewPostReceptionsRequest calls the generic PostReceptions builder with application/json body
func NewPostReceptionsRequestWithBody ¶
func NewPostReceptionsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPostReceptionsRequestWithBody generates requests for PostReceptions with any type of body
func NewPostRegisterRequest ¶
func NewPostRegisterRequest(server string, body PostRegisterJSONRequestBody) (*http.Request, error)
NewPostRegisterRequest calls the generic PostRegister builder with application/json body
func NewPostRegisterRequestWithBody ¶
func NewPostRegisterRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPostRegisterRequestWithBody generates requests for PostRegister with any type of body
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 Client ¶
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the swagger spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []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) GetPvz ¶
func (c *Client) GetPvz(ctx context.Context, params *GetPvzParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PostDummyLogin ¶
func (c *Client) PostDummyLogin(ctx context.Context, body PostDummyLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PostDummyLoginWithBody ¶
func (*Client) PostLogin ¶
func (c *Client) PostLogin(ctx context.Context, body PostLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PostLoginWithBody ¶
func (*Client) PostProducts ¶
func (c *Client) PostProducts(ctx context.Context, body PostProductsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PostProductsWithBody ¶
func (*Client) PostPvz ¶
func (c *Client) PostPvz(ctx context.Context, body PostPvzJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PostPvzPvzIdCloseLastReception ¶
func (c *Client) PostPvzPvzIdCloseLastReception(ctx context.Context, pvzId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PostPvzPvzIdDeleteLastProduct ¶
func (c *Client) PostPvzPvzIdDeleteLastProduct(ctx context.Context, pvzId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PostPvzWithBody ¶
func (*Client) PostReceptions ¶
func (c *Client) PostReceptions(ctx context.Context, body PostReceptionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PostReceptionsWithBody ¶
func (*Client) PostRegister ¶
func (c *Client) PostRegister(ctx context.Context, body PostRegisterJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface {
// PostDummyLoginWithBody request with any body
PostDummyLoginWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PostDummyLogin(ctx context.Context, body PostDummyLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostLoginWithBody request with any body
PostLoginWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PostLogin(ctx context.Context, body PostLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostProductsWithBody request with any body
PostProductsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PostProducts(ctx context.Context, body PostProductsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetPvz request
GetPvz(ctx context.Context, params *GetPvzParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostPvzWithBody request with any body
PostPvzWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PostPvz(ctx context.Context, body PostPvzJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostPvzPvzIdCloseLastReception request
PostPvzPvzIdCloseLastReception(ctx context.Context, pvzId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostPvzPvzIdDeleteLastProduct request
PostPvzPvzIdDeleteLastProduct(ctx context.Context, pvzId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostReceptionsWithBody request with any body
PostReceptionsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PostReceptions(ctx context.Context, body PostReceptionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostRegisterWithBody request with any body
PostRegisterWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PostRegister(ctx context.Context, body PostRegisterJSONRequestBody, reqEditors ...RequestEditorFn) (*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) GetPvzWithResponse ¶
func (c *ClientWithResponses) GetPvzWithResponse(ctx context.Context, params *GetPvzParams, reqEditors ...RequestEditorFn) (*GetPvzResponse, error)
GetPvzWithResponse request returning *GetPvzResponse
func (*ClientWithResponses) PostDummyLoginWithBodyWithResponse ¶
func (c *ClientWithResponses) PostDummyLoginWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostDummyLoginResponse, error)
PostDummyLoginWithBodyWithResponse request with arbitrary body returning *PostDummyLoginResponse
func (*ClientWithResponses) PostDummyLoginWithResponse ¶
func (c *ClientWithResponses) PostDummyLoginWithResponse(ctx context.Context, body PostDummyLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*PostDummyLoginResponse, error)
func (*ClientWithResponses) PostLoginWithBodyWithResponse ¶
func (c *ClientWithResponses) PostLoginWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostLoginResponse, error)
PostLoginWithBodyWithResponse request with arbitrary body returning *PostLoginResponse
func (*ClientWithResponses) PostLoginWithResponse ¶
func (c *ClientWithResponses) PostLoginWithResponse(ctx context.Context, body PostLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*PostLoginResponse, error)
func (*ClientWithResponses) PostProductsWithBodyWithResponse ¶
func (c *ClientWithResponses) PostProductsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostProductsResponse, error)
PostProductsWithBodyWithResponse request with arbitrary body returning *PostProductsResponse
func (*ClientWithResponses) PostProductsWithResponse ¶
func (c *ClientWithResponses) PostProductsWithResponse(ctx context.Context, body PostProductsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostProductsResponse, error)
func (*ClientWithResponses) PostPvzPvzIdCloseLastReceptionWithResponse ¶
func (c *ClientWithResponses) PostPvzPvzIdCloseLastReceptionWithResponse(ctx context.Context, pvzId openapi_types.UUID, reqEditors ...RequestEditorFn) (*PostPvzPvzIdCloseLastReceptionResponse, error)
PostPvzPvzIdCloseLastReceptionWithResponse request returning *PostPvzPvzIdCloseLastReceptionResponse
func (*ClientWithResponses) PostPvzPvzIdDeleteLastProductWithResponse ¶
func (c *ClientWithResponses) PostPvzPvzIdDeleteLastProductWithResponse(ctx context.Context, pvzId openapi_types.UUID, reqEditors ...RequestEditorFn) (*PostPvzPvzIdDeleteLastProductResponse, error)
PostPvzPvzIdDeleteLastProductWithResponse request returning *PostPvzPvzIdDeleteLastProductResponse
func (*ClientWithResponses) PostPvzWithBodyWithResponse ¶
func (c *ClientWithResponses) PostPvzWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostPvzResponse, error)
PostPvzWithBodyWithResponse request with arbitrary body returning *PostPvzResponse
func (*ClientWithResponses) PostPvzWithResponse ¶
func (c *ClientWithResponses) PostPvzWithResponse(ctx context.Context, body PostPvzJSONRequestBody, reqEditors ...RequestEditorFn) (*PostPvzResponse, error)
func (*ClientWithResponses) PostReceptionsWithBodyWithResponse ¶
func (c *ClientWithResponses) PostReceptionsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostReceptionsResponse, error)
PostReceptionsWithBodyWithResponse request with arbitrary body returning *PostReceptionsResponse
func (*ClientWithResponses) PostReceptionsWithResponse ¶
func (c *ClientWithResponses) PostReceptionsWithResponse(ctx context.Context, body PostReceptionsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostReceptionsResponse, error)
func (*ClientWithResponses) PostRegisterWithBodyWithResponse ¶
func (c *ClientWithResponses) PostRegisterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostRegisterResponse, error)
PostRegisterWithBodyWithResponse request with arbitrary body returning *PostRegisterResponse
func (*ClientWithResponses) PostRegisterWithResponse ¶
func (c *ClientWithResponses) PostRegisterWithResponse(ctx context.Context, body PostRegisterJSONRequestBody, reqEditors ...RequestEditorFn) (*PostRegisterResponse, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// PostDummyLoginWithBodyWithResponse request with any body
PostDummyLoginWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostDummyLoginResponse, error)
PostDummyLoginWithResponse(ctx context.Context, body PostDummyLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*PostDummyLoginResponse, error)
// PostLoginWithBodyWithResponse request with any body
PostLoginWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostLoginResponse, error)
PostLoginWithResponse(ctx context.Context, body PostLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*PostLoginResponse, error)
// PostProductsWithBodyWithResponse request with any body
PostProductsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostProductsResponse, error)
PostProductsWithResponse(ctx context.Context, body PostProductsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostProductsResponse, error)
// GetPvzWithResponse request
GetPvzWithResponse(ctx context.Context, params *GetPvzParams, reqEditors ...RequestEditorFn) (*GetPvzResponse, error)
// PostPvzWithBodyWithResponse request with any body
PostPvzWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostPvzResponse, error)
PostPvzWithResponse(ctx context.Context, body PostPvzJSONRequestBody, reqEditors ...RequestEditorFn) (*PostPvzResponse, error)
// PostPvzPvzIdCloseLastReceptionWithResponse request
PostPvzPvzIdCloseLastReceptionWithResponse(ctx context.Context, pvzId openapi_types.UUID, reqEditors ...RequestEditorFn) (*PostPvzPvzIdCloseLastReceptionResponse, error)
// PostPvzPvzIdDeleteLastProductWithResponse request
PostPvzPvzIdDeleteLastProductWithResponse(ctx context.Context, pvzId openapi_types.UUID, reqEditors ...RequestEditorFn) (*PostPvzPvzIdDeleteLastProductResponse, error)
// PostReceptionsWithBodyWithResponse request with any body
PostReceptionsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostReceptionsResponse, error)
PostReceptionsWithResponse(ctx context.Context, body PostReceptionsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostReceptionsResponse, error)
// PostRegisterWithBodyWithResponse request with any body
PostRegisterWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostRegisterResponse, error)
PostRegisterWithResponse(ctx context.Context, body PostRegisterJSONRequestBody, reqEditors ...RequestEditorFn) (*PostRegisterResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
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 GetPvzParams ¶
type GetPvzParams struct {
// StartDate Начальная дата диапазона
StartDate *time.Time `form:"startDate,omitempty" json:"startDate,omitempty"`
// EndDate Конечная дата диапазона
EndDate *time.Time `form:"endDate,omitempty" json:"endDate,omitempty"`
// Page Номер страницы
Page *int `form:"page,omitempty" json:"page,omitempty"`
// Limit Количество элементов на странице
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}
GetPvzParams defines parameters for GetPvz.
type GetPvzResponse ¶
type GetPvzResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *[]struct {
Pvz *PVZ `json:"pvz,omitempty"`
Receptions *[]struct {
Products *[]Product `json:"products,omitempty"`
Reception *Reception `json:"reception,omitempty"`
} `json:"receptions,omitempty"`
}
}
func ParseGetPvzResponse ¶
func ParseGetPvzResponse(rsp *http.Response) (*GetPvzResponse, error)
ParseGetPvzResponse parses an HTTP response from a GetPvzWithResponse call
func (GetPvzResponse) Status ¶
func (r GetPvzResponse) Status() string
Status returns HTTPResponse.Status
func (GetPvzResponse) StatusCode ¶
func (r GetPvzResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type PVZ ¶
type PVZ struct {
City PVZCity `json:"city"`
Id *openapi_types.UUID `json:"id,omitempty"`
RegistrationDate *time.Time `json:"registrationDate,omitempty"`
}
PVZ defines model for PVZ.
type PostDummyLoginJSONBody ¶
type PostDummyLoginJSONBody struct {
Role PostDummyLoginJSONBodyRole `json:"role"`
}
PostDummyLoginJSONBody defines parameters for PostDummyLogin.
type PostDummyLoginJSONBodyRole ¶
type PostDummyLoginJSONBodyRole string
PostDummyLoginJSONBodyRole defines parameters for PostDummyLogin.
const ( PostDummyLoginJSONBodyRoleEmployee PostDummyLoginJSONBodyRole = "employee" PostDummyLoginJSONBodyRoleModerator PostDummyLoginJSONBodyRole = "moderator" )
Defines values for PostDummyLoginJSONBodyRole.
type PostDummyLoginJSONRequestBody ¶
type PostDummyLoginJSONRequestBody PostDummyLoginJSONBody
PostDummyLoginJSONRequestBody defines body for PostDummyLogin for application/json ContentType.
type PostDummyLoginResponse ¶
type PostDummyLoginResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Token
JSON400 *Error
}
func ParsePostDummyLoginResponse ¶
func ParsePostDummyLoginResponse(rsp *http.Response) (*PostDummyLoginResponse, error)
ParsePostDummyLoginResponse parses an HTTP response from a PostDummyLoginWithResponse call
func (PostDummyLoginResponse) Status ¶
func (r PostDummyLoginResponse) Status() string
Status returns HTTPResponse.Status
func (PostDummyLoginResponse) StatusCode ¶
func (r PostDummyLoginResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PostLoginJSONBody ¶
type PostLoginJSONBody struct {
Email openapi_types.Email `json:"email"`
Password string `json:"password"`
}
PostLoginJSONBody defines parameters for PostLogin.
type PostLoginJSONRequestBody ¶
type PostLoginJSONRequestBody PostLoginJSONBody
PostLoginJSONRequestBody defines body for PostLogin for application/json ContentType.
type PostLoginResponse ¶
type PostLoginResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Token
JSON401 *Error
}
func ParsePostLoginResponse ¶
func ParsePostLoginResponse(rsp *http.Response) (*PostLoginResponse, error)
ParsePostLoginResponse parses an HTTP response from a PostLoginWithResponse call
func (PostLoginResponse) Status ¶
func (r PostLoginResponse) Status() string
Status returns HTTPResponse.Status
func (PostLoginResponse) StatusCode ¶
func (r PostLoginResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PostProductsJSONBody ¶
type PostProductsJSONBody struct {
PvzId openapi_types.UUID `json:"pvzId"`
Type PostProductsJSONBodyType `json:"type"`
}
PostProductsJSONBody defines parameters for PostProducts.
type PostProductsJSONBodyType ¶
type PostProductsJSONBodyType string
PostProductsJSONBodyType defines parameters for PostProducts.
const ( PostProductsJSONBodyTypeОбувь PostProductsJSONBodyType = "обувь" PostProductsJSONBodyTypeОдежда PostProductsJSONBodyType = "одежда" PostProductsJSONBodyTypeЭлектроника PostProductsJSONBodyType = "электроника" )
Defines values for PostProductsJSONBodyType.
type PostProductsJSONRequestBody ¶
type PostProductsJSONRequestBody PostProductsJSONBody
PostProductsJSONRequestBody defines body for PostProducts for application/json ContentType.
type PostProductsResponse ¶
type PostProductsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *Product
JSON400 *Error
JSON403 *Error
}
func ParsePostProductsResponse ¶
func ParsePostProductsResponse(rsp *http.Response) (*PostProductsResponse, error)
ParsePostProductsResponse parses an HTTP response from a PostProductsWithResponse call
func (PostProductsResponse) Status ¶
func (r PostProductsResponse) Status() string
Status returns HTTPResponse.Status
func (PostProductsResponse) StatusCode ¶
func (r PostProductsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PostPvzJSONRequestBody ¶
type PostPvzJSONRequestBody = PVZ
PostPvzJSONRequestBody defines body for PostPvz for application/json ContentType.
type PostPvzPvzIdCloseLastReceptionResponse ¶
type PostPvzPvzIdCloseLastReceptionResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Reception
JSON400 *Error
JSON403 *Error
}
func ParsePostPvzPvzIdCloseLastReceptionResponse ¶
func ParsePostPvzPvzIdCloseLastReceptionResponse(rsp *http.Response) (*PostPvzPvzIdCloseLastReceptionResponse, error)
ParsePostPvzPvzIdCloseLastReceptionResponse parses an HTTP response from a PostPvzPvzIdCloseLastReceptionWithResponse call
func (PostPvzPvzIdCloseLastReceptionResponse) Status ¶
func (r PostPvzPvzIdCloseLastReceptionResponse) Status() string
Status returns HTTPResponse.Status
func (PostPvzPvzIdCloseLastReceptionResponse) StatusCode ¶
func (r PostPvzPvzIdCloseLastReceptionResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PostPvzPvzIdDeleteLastProductResponse ¶
type PostPvzPvzIdDeleteLastProductResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *Error
JSON403 *Error
}
func ParsePostPvzPvzIdDeleteLastProductResponse ¶
func ParsePostPvzPvzIdDeleteLastProductResponse(rsp *http.Response) (*PostPvzPvzIdDeleteLastProductResponse, error)
ParsePostPvzPvzIdDeleteLastProductResponse parses an HTTP response from a PostPvzPvzIdDeleteLastProductWithResponse call
func (PostPvzPvzIdDeleteLastProductResponse) Status ¶
func (r PostPvzPvzIdDeleteLastProductResponse) Status() string
Status returns HTTPResponse.Status
func (PostPvzPvzIdDeleteLastProductResponse) StatusCode ¶
func (r PostPvzPvzIdDeleteLastProductResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PostPvzResponse ¶
type PostPvzResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *PVZ
JSON400 *Error
JSON403 *Error
}
func ParsePostPvzResponse ¶
func ParsePostPvzResponse(rsp *http.Response) (*PostPvzResponse, error)
ParsePostPvzResponse parses an HTTP response from a PostPvzWithResponse call
func (PostPvzResponse) Status ¶
func (r PostPvzResponse) Status() string
Status returns HTTPResponse.Status
func (PostPvzResponse) StatusCode ¶
func (r PostPvzResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PostReceptionsJSONBody ¶
type PostReceptionsJSONBody struct {
PvzId openapi_types.UUID `json:"pvzId"`
}
PostReceptionsJSONBody defines parameters for PostReceptions.
type PostReceptionsJSONRequestBody ¶
type PostReceptionsJSONRequestBody PostReceptionsJSONBody
PostReceptionsJSONRequestBody defines body for PostReceptions for application/json ContentType.
type PostReceptionsResponse ¶
type PostReceptionsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *Reception
JSON400 *Error
JSON403 *Error
}
func ParsePostReceptionsResponse ¶
func ParsePostReceptionsResponse(rsp *http.Response) (*PostReceptionsResponse, error)
ParsePostReceptionsResponse parses an HTTP response from a PostReceptionsWithResponse call
func (PostReceptionsResponse) Status ¶
func (r PostReceptionsResponse) Status() string
Status returns HTTPResponse.Status
func (PostReceptionsResponse) StatusCode ¶
func (r PostReceptionsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PostRegisterJSONBody ¶
type PostRegisterJSONBody struct {
Email openapi_types.Email `json:"email"`
Password string `json:"password"`
Role PostRegisterJSONBodyRole `json:"role"`
}
PostRegisterJSONBody defines parameters for PostRegister.
type PostRegisterJSONBodyRole ¶
type PostRegisterJSONBodyRole string
PostRegisterJSONBodyRole defines parameters for PostRegister.
const ( Employee PostRegisterJSONBodyRole = "employee" Moderator PostRegisterJSONBodyRole = "moderator" )
Defines values for PostRegisterJSONBodyRole.
type PostRegisterJSONRequestBody ¶
type PostRegisterJSONRequestBody PostRegisterJSONBody
PostRegisterJSONRequestBody defines body for PostRegister for application/json ContentType.
type PostRegisterResponse ¶
type PostRegisterResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *User
JSON400 *Error
}
func ParsePostRegisterResponse ¶
func ParsePostRegisterResponse(rsp *http.Response) (*PostRegisterResponse, error)
ParsePostRegisterResponse parses an HTTP response from a PostRegisterWithResponse call
func (PostRegisterResponse) Status ¶
func (r PostRegisterResponse) Status() string
Status returns HTTPResponse.Status
func (PostRegisterResponse) StatusCode ¶
func (r PostRegisterResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Product ¶
type Product struct {
DateTime *time.Time `json:"dateTime,omitempty"`
Id *openapi_types.UUID `json:"id,omitempty"`
ReceptionId openapi_types.UUID `json:"receptionId"`
Type ProductType `json:"type"`
}
Product defines model for Product.
type ProductType ¶
type ProductType string
ProductType defines model for Product.Type.
const ( ProductTypeОбувь ProductType = "обувь" ProductTypeОдежда ProductType = "одежда" ProductTypeЭлектроника ProductType = "электроника" )
Defines values for ProductType.
type Reception ¶
type Reception struct {
DateTime time.Time `json:"dateTime"`
Id *openapi_types.UUID `json:"id,omitempty"`
PvzId openapi_types.UUID `json:"pvzId"`
Status ReceptionStatus `json:"status"`
}
Reception defines model for Reception.
type ReceptionStatus ¶
type ReceptionStatus string
ReceptionStatus defines model for Reception.Status.
const ( Close ReceptionStatus = "close" InProgress ReceptionStatus = "in_progress" )
Defines values for ReceptionStatus.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type ServerInterface ¶
type ServerInterface interface {
// Получение тестового токена
// (POST /dummyLogin)
PostDummyLogin(ctx echo.Context) error
// Авторизация пользователя
// (POST /login)
PostLogin(ctx echo.Context) error
// Добавление товара в текущую приемку (только для сотрудников ПВЗ)
// (POST /products)
PostProducts(ctx echo.Context) error
// Получение списка ПВЗ с фильтрацией по дате приемки и пагинацией
// (GET /pvz)
GetPvz(ctx echo.Context, params GetPvzParams) error
// Создание ПВЗ (только для модераторов)
// (POST /pvz)
PostPvz(ctx echo.Context) error
// Закрытие последней открытой приемки товаров в рамках ПВЗ
// (POST /pvz/{pvzId}/close_last_reception)
PostPvzPvzIdCloseLastReception(ctx echo.Context, pvzId openapi_types.UUID) error
// Удаление последнего добавленного товара из текущей приемки (LIFO, только для сотрудников ПВЗ)
// (POST /pvz/{pvzId}/delete_last_product)
PostPvzPvzIdDeleteLastProduct(ctx echo.Context, pvzId openapi_types.UUID) error
// Создание новой приемки товаров (только для сотрудников ПВЗ)
// (POST /receptions)
PostReceptions(ctx echo.Context) error
// Регистрация пользователя
// (POST /register)
PostRegister(ctx echo.Context) error
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) GetPvz ¶
func (w *ServerInterfaceWrapper) GetPvz(ctx echo.Context) error
GetPvz converts echo context to params.
func (*ServerInterfaceWrapper) PostDummyLogin ¶
func (w *ServerInterfaceWrapper) PostDummyLogin(ctx echo.Context) error
PostDummyLogin converts echo context to params.
func (*ServerInterfaceWrapper) PostLogin ¶
func (w *ServerInterfaceWrapper) PostLogin(ctx echo.Context) error
PostLogin converts echo context to params.
func (*ServerInterfaceWrapper) PostProducts ¶
func (w *ServerInterfaceWrapper) PostProducts(ctx echo.Context) error
PostProducts converts echo context to params.
func (*ServerInterfaceWrapper) PostPvz ¶
func (w *ServerInterfaceWrapper) PostPvz(ctx echo.Context) error
PostPvz converts echo context to params.
func (*ServerInterfaceWrapper) PostPvzPvzIdCloseLastReception ¶
func (w *ServerInterfaceWrapper) PostPvzPvzIdCloseLastReception(ctx echo.Context) error
PostPvzPvzIdCloseLastReception converts echo context to params.
func (*ServerInterfaceWrapper) PostPvzPvzIdDeleteLastProduct ¶
func (w *ServerInterfaceWrapper) PostPvzPvzIdDeleteLastProduct(ctx echo.Context) error
PostPvzPvzIdDeleteLastProduct converts echo context to params.
func (*ServerInterfaceWrapper) PostReceptions ¶
func (w *ServerInterfaceWrapper) PostReceptions(ctx echo.Context) error
PostReceptions converts echo context to params.
func (*ServerInterfaceWrapper) PostRegister ¶
func (w *ServerInterfaceWrapper) PostRegister(ctx echo.Context) error
PostRegister converts echo context to params.
type User ¶
type User struct {
Email openapi_types.Email `json:"email"`
Id *openapi_types.UUID `json:"id,omitempty"`
Role UserRole `json:"role"`
}
User defines model for User.