Documentation
¶
Index ¶
- func EchoErrorMessage(message string) echo.Map
- type Handler
- func (h Handler) Create(ctx echo.Context) error
- func (h Handler) Delete(ctx echo.Context) error
- func (h Handler) Disable(ctx echo.Context) error
- func (h Handler) Enable(ctx echo.Context) error
- func (h Handler) List(ctx echo.Context) error
- func (h Handler) RotateWriteKey(ctx echo.Context) error
- func (h Handler) SetRoutes(e *echo.Echo)
- func (h Handler) Show(ctx echo.Context) error
- func (h Handler) Update(ctx echo.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EchoErrorMessage ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func New ¶
func New(authSvc authservice.Service, sourceSvc sourceservice.Service) Handler
func (Handler) Create ¶
Create godoc
@Summary Create source
@Description Create source
@Tags Source
@Accept json
@Produce json
@Param request body sourceparam.CreateRequest true "Create source request body"
@Success 201 {object} sourceparam.CreateResponse
@Failure 400 {object} httputil.HTTPError
@Failure 401 {object} httputil.HTTPError
@Failure 500 {object} httputil.HTTPError
@Security JWTToken
@Router /sources [post]
func (Handler) Delete ¶
Delete godoc
@Summary Delete source
@Description Delete source
@Tags Source
@Accept json
@Produce json
@Param source_id path string true "Source identifier"
@Success 200 {object} sourceparam.DeleteResponse
@Failure 400 {object} httputil.HTTPError
@Failure 401 {object} httputil.HTTPError
@Failure 500 {object} httputil.HTTPError
@Security JWTToken
@Router /sources/{source_id} [delete]
func (Handler) Disable ¶
Update godoc
@Summary Disable source
@Description Disable source
@Tags Source
@Accept json
@Produce json
@Param source_id path string true "Source identifier"
@Success 201 {object} sourceparam.DisableResponse
@Failure 400 {object} httputil.HTTPError
@Failure 401 {object} httputil.HTTPError
@Failure 500 {object} httputil.HTTPError
@Security JWTToken
@Router /sources/{source_id}/disable [get]
func (Handler) Enable ¶
Update godoc
@Summary Enable source
@Description Enable source
@Tags Source
@Accept json
@Produce json
@Param source_id path string true "Source identifier"
@Success 201 {object} sourceparam.EnableResponse
@Failure 400 {object} httputil.HTTPError
@Failure 401 {object} httputil.HTTPError
@Failure 500 {object} httputil.HTTPError
@Security JWTToken
@Router /sources/{source_id}/enable [get]
func (Handler) List ¶
List godoc
@Summary List sources
@Description List sources
@Tags Source
@Accept json
@Produce json
@Param last_token_id query string false "Last token fetched"
@Param per_page query int false "Per page count"
@Success 200 {object} sourceparam.ListResponse
@Failure 400 {object} httputil.HTTPError
@Failure 401 {object} httputil.HTTPError
@Failure 500 {object} httputil.HTTPError
@Security JWTToken
@Router /sources [get]
func (Handler) RotateWriteKey ¶
Update godoc
@Summary Rotate writekey
@Description Rotate writekey
@Tags Source
@Accept json
@Produce json
@Param source_id path string true "Source identifier"
@Success 201 {object} sourceparam.ShowResponse
@Failure 400 {object} httputil.HTTPError
@Failure 401 {object} httputil.HTTPError
@Failure 500 {object} httputil.HTTPError
@Security JWTToken
@Router /sources/{source_id}/rotate-write-key [get]
func (Handler) Show ¶
Update godoc
@Summary Show source
@Description Show source
@Tags Source
@Accept json
@Produce json
@Param source_id path string true "Source identifier"
@Success 201 {object} sourceparam.ShowResponse
@Failure 400 {object} httputil.HTTPError
@Failure 401 {object} httputil.HTTPError
@Failure 500 {object} httputil.HTTPError
@Security JWTToken
@Router /sources/{source_id} [get]
func (Handler) Update ¶
Update godoc
@Summary Update source
@Description Update source
@Tags Source
@Accept json
@Produce json
@Param source_id path string true "Source identifier"
@Param request body sourceparam.UpdateRequest true "Update source request body"
@Success 201 {object} sourceparam.UpdateResponse
@Failure 400 {object} httputil.HTTPError
@Failure 401 {object} httputil.HTTPError
@Failure 500 {object} httputil.HTTPError
@Security JWTToken
@Router /sources/{source_id} [post]
Click to show internal directories.
Click to hide internal directories.