Documentation ¶
Overview ¶
Package v1 provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.5-0.20230506011706-29ebe3262399 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 AssignedSegmentDTO
- type ChangeUserSegmentsReq
- type CreateReportReq
- type CreateReportResp
- type CreateSegmentReq
- type DeleteSegmentParams
- type EchoRouter
- type GetUserSegmentsParams
- type Handler
- func (h Handler) DeleteSegment(eCtx echo.Context, params DeleteSegmentParams) error
- func (h Handler) GetUserSegments(eCtx echo.Context, params GetUserSegmentsParams) error
- func (h Handler) PostReport(eCtx echo.Context) error
- func (h Handler) PostSegment(eCtx echo.Context) error
- func (h Handler) PostUserSegments(eCtx echo.Context) error
- type PostReportJSONRequestBody
- type PostSegmentJSONRequestBody
- type PostUserSegmentsJSONRequestBody
- type ServerInterface
- type ServerInterfaceWrapper
- func (w *ServerInterfaceWrapper) DeleteSegment(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetUserSegments(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostReport(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostSegment(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PostUserSegments(ctx echo.Context) error
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 AssignedSegmentDTO ¶
type AssignedSegmentDTO struct { SegmentName string `json:"segment_name"` Ttl *int32 `json:"ttl,omitempty"` }
AssignedSegmentDTO defines model for AssignedSegmentDTO.
type ChangeUserSegmentsReq ¶
type ChangeUserSegmentsReq struct { // AddSegments Добавляемые сегменты AddSegments []AssignedSegmentDTO `json:"add_segments"` // DeleteSegments Удаляемые сегменты DeleteSegments []string `json:"delete_segments"` UserId int `json:"user_id"` }
ChangeUserSegmentsReq defines model for ChangeUserSegmentsReq.
type CreateReportReq ¶
type CreateReportReq struct { // From Начальная дата отчета From *openapi_types.Date `json:"from,omitempty"` // To Конечная дата отчета To *openapi_types.Date `json:"to,omitempty"` // UserIds ID пользователей UserIds *[]int `json:"user_ids,omitempty"` }
CreateReportReq defines model for CreateReportReq.
type CreateReportResp ¶
type CreateReportResp struct { // Link Ссылка на отчет Link string `json:"link"` }
CreateReportResp defines model for CreateReportResp.
type CreateSegmentReq ¶
type CreateSegmentReq struct { // SegmentName Название сегмента SegmentName string `json:"segment_name"` // UserPercentage Процент пользователей в сегменте UserPercentage *int `json:"user_percentage,omitempty"` }
CreateSegmentReq defines model for CreateSegmentReq.
type DeleteSegmentParams ¶
type DeleteSegmentParams struct { // SegmentName Название сегмента SegmentName string `form:"segment_name" json:"segment_name"` }
DeleteSegmentParams defines parameters for DeleteSegment.
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 GetUserSegmentsParams ¶
type GetUserSegmentsParams struct { // UserId ID пользователя UserId int `form:"user_id" json:"user_id"` }
GetUserSegmentsParams defines parameters for GetUserSegments.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(s segmentUseCase, u userUseCase) *Handler
func (Handler) DeleteSegment ¶
func (h Handler) DeleteSegment(eCtx echo.Context, params DeleteSegmentParams) error
func (Handler) GetUserSegments ¶
func (h Handler) GetUserSegments(eCtx echo.Context, params GetUserSegmentsParams) error
func (Handler) PostReport ¶
func (Handler) PostSegment ¶
func (Handler) PostUserSegments ¶
type PostReportJSONRequestBody ¶
type PostReportJSONRequestBody = CreateReportReq
PostReportJSONRequestBody defines body for PostReport for application/json ContentType.
type PostSegmentJSONRequestBody ¶
type PostSegmentJSONRequestBody = CreateSegmentReq
PostSegmentJSONRequestBody defines body for PostSegment for application/json ContentType.
type PostUserSegmentsJSONRequestBody ¶
type PostUserSegmentsJSONRequestBody = ChangeUserSegmentsReq
PostUserSegmentsJSONRequestBody defines body for PostUserSegments for application/json ContentType.
type ServerInterface ¶
type ServerInterface interface { // Выгрузить историю сегментов пользователя // (POST /report) PostReport(ctx echo.Context) error // Удалить сегмент // (DELETE /segment) DeleteSegment(ctx echo.Context, params DeleteSegmentParams) error // Создать сегмент // (POST /segment) PostSegment(ctx echo.Context) error // Получить сегменты пользователя // (GET /user/segments) GetUserSegments(ctx echo.Context, params GetUserSegmentsParams) error // Добавить и удалить сегменты пользователя // (POST /user/segments) PostUserSegments(ctx echo.Context) error }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) DeleteSegment ¶
func (w *ServerInterfaceWrapper) DeleteSegment(ctx echo.Context) error
DeleteSegment converts echo context to params.
func (*ServerInterfaceWrapper) GetUserSegments ¶
func (w *ServerInterfaceWrapper) GetUserSegments(ctx echo.Context) error
GetUserSegments converts echo context to params.
func (*ServerInterfaceWrapper) PostReport ¶
func (w *ServerInterfaceWrapper) PostReport(ctx echo.Context) error
PostReport converts echo context to params.
func (*ServerInterfaceWrapper) PostSegment ¶
func (w *ServerInterfaceWrapper) PostSegment(ctx echo.Context) error
PostSegment converts echo context to params.
func (*ServerInterfaceWrapper) PostUserSegments ¶
func (w *ServerInterfaceWrapper) PostUserSegments(ctx echo.Context) error
PostUserSegments converts echo context to params.