Documentation ¶
Overview ¶
Package apiv1 provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.9.0 DO NOT EDIT.
Package apiv1 provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.9.0 DO NOT EDIT.
Package apiv1 provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.9.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 Cache
- type CacheDeps
- type Consume
- type Consumer
- type ConsumerCacherGateway
- type ConsumerDeps
- type ConsumerRepositoryGateway
- type DataResult
- type DeleteHandlerParams
- type EchoRouter
- type Enity
- type ErrorAnsw
- type ErrorAnswBody
- type Handler
- type HandlerCacheGateway
- type HandlerDeps
- type NullMeta
- type NullString
- type NullTime
- type PostHandlerJSONBody
- type PostHandlerJSONRequestBody
- type Publish
- type Repository
- func (r *Repository) CreateTest(ctx context.Context, data *Enity) (*Enity, error)
- func (r *Repository) GetByCode(ctx context.Context, code string) (*Enity, error)
- func (r *Repository) GetByID(ctx context.Context, id int64) (*Enity, error)
- func (r *Repository) HardDeleteByID(ctx context.Context, id int64) error
- func (r *Repository) SoftDeleteByID(ctx context.Context, id int64) error
- type RepositoryDeps
- type RepositoryGateway
- type ResultAnsw
- 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 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 CacheDeps ¶
type CacheDeps struct {
Cache *rediscache.Cache
}
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
func NewConsumer ¶
func NewConsumer(deps *ConsumerDeps) *Consumer
type ConsumerCacherGateway ¶
type ConsumerDeps ¶
type ConsumerDeps struct { Repository ConsumerRepositoryGateway Cache ConsumerCacherGateway Publisher *rabbitmqpub.Publisher }
type DataResult ¶
type DataResult struct {
Result *Enity `json:"result,omitempty"`
}
DataResult defines model for DataResult.
type DeleteHandlerParams ¶
type DeleteHandlerParams struct { // Hard delete data, if equal true, delete hard Hard *bool `json:"hard,omitempty"` }
DeleteHandlerParams defines parameters for DeleteHandler.
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 Enity ¶
type Enity struct { Code *string `db:"code" json:"code,omitempty"` CreatedAt *NullTime `db:"created_at" json:"created_at,omitempty"` DeletedAt *NullTime `db:"deleted_at" json:"deleted_at,omitempty"` Id *int64 `db:"id" json:"id,omitempty"` Meta *NullMeta `db:"meta" json:"meta,omitempty"` UpdatedAt *NullTime `db:"updated_at" json:"updated_at,omitempty"` }
Enity defines model for Enity.
func (*Enity) MarshalBinary ¶
func (*Enity) UnmarshalBinary ¶
type ErrorAnsw ¶
type ErrorAnsw struct {
Error *ErrorAnswBody `json:"error,omitempty"`
}
ErrorAnsw defines model for ErrorAnsw.
type ErrorAnswBody ¶
type ErrorAnswBody struct { Code *string `json:"code,omitempty"` Details *string `json:"details,omitempty"` StatusCode *int `json:"statusCode,omitempty"` }
ErrorAnswBody defines model for ErrorAnswBody.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(deps *HandlerDeps) *Handler
func (*Handler) DeleteHandler ¶
func (a *Handler) DeleteHandler(ec echo.Context, id int64, params DeleteHandlerParams) error
func (*Handler) GetHandler ¶
func (*Handler) PostHandler ¶
func (*Handler) PostToCacheHandler ¶
type HandlerCacheGateway ¶
type HandlerDeps ¶
type HandlerDeps struct { Repository RepositoryGateway Cache HandlerCacheGateway }
type NullMeta ¶
type NullMeta struct {
garageTypes.NullMeta
}
func NewNullMeta ¶
func NewNullMeta() *NullMeta
type NullString ¶
type NullString struct {
garageTypes.NullString
}
func NewNullString ¶
func NewNullString() *NullString
type NullTime ¶
type NullTime struct {
garageTypes.NullTime
}
func NewNullTime ¶
func NewNullTime() *NullTime
type PostHandlerJSONBody ¶
type PostHandlerJSONBody Enity
PostHandlerJSONBody defines parameters for PostHandler.
type PostHandlerJSONRequestBody ¶
type PostHandlerJSONRequestBody PostHandlerJSONBody
PostHandlerJSONRequestBody defines body for PostHandler for application/json ContentType.
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(deps *RepositoryDeps) (*Repository, error)
func (*Repository) CreateTest ¶
func (*Repository) HardDeleteByID ¶
func (r *Repository) HardDeleteByID(ctx context.Context, id int64) error
func (*Repository) SoftDeleteByID ¶
func (r *Repository) SoftDeleteByID(ctx context.Context, id int64) error
type RepositoryDeps ¶
type RepositoryGateway ¶
type RepositoryGateway interface { CreateTest(ctx context.Context, data *Enity) (*Enity, error) GetByID(ctx context.Context, id int64) (data *Enity, err error) GetByCode(ctx context.Context, code string) (data *Enity, err error) HardDeleteByID(ctx context.Context, id int64) (err error) SoftDeleteByID(ctx context.Context, id int64) (err error) }
type ResultAnsw ¶
type ResultAnsw struct {
Result *string `json:"result,omitempty"`
}
ResultAnsw defines model for ResultAnsw.
type ServerInterface ¶
type ServerInterface interface { // This handler create new data // (POST /test) PostHandler(ctx echo.Context) error // This handler deletes data for requested ID // (DELETE /test/{id}) DeleteHandler(ctx echo.Context, id int64, params DeleteHandlerParams) error // This handler getting data for requested ID // (GET /test/{id}) GetHandler(ctx echo.Context, id int64) error // This handler put data to cache for requested ID // (POST /test/{id}) PostToCacheHandler(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) DeleteHandler ¶
func (w *ServerInterfaceWrapper) DeleteHandler(ctx echo.Context) error
DeleteHandler converts echo context to params.
func (*ServerInterfaceWrapper) GetHandler ¶
func (w *ServerInterfaceWrapper) GetHandler(ctx echo.Context) error
GetHandler converts echo context to params.
func (*ServerInterfaceWrapper) PostHandler ¶
func (w *ServerInterfaceWrapper) PostHandler(ctx echo.Context) error
PostHandler converts echo context to params.
func (*ServerInterfaceWrapper) PostToCacheHandler ¶
func (w *ServerInterfaceWrapper) PostToCacheHandler(ctx echo.Context) error
PostToCacheHandler converts echo context to params.