sourcehandler

package
v0.0.0-...-9e81241 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EchoErrorMessage

func EchoErrorMessage(message string) echo.Map

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

func (h Handler) Create(ctx echo.Context) error

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

func (h Handler) Delete(ctx echo.Context) error

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

func (h Handler) Disable(ctx echo.Context) error

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

func (h Handler) Enable(ctx echo.Context) error

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

func (h Handler) List(ctx echo.Context) error

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

func (h Handler) RotateWriteKey(ctx echo.Context) error

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) SetRoutes

func (h Handler) SetRoutes(e *echo.Echo)

func (Handler) Show

func (h Handler) Show(ctx echo.Context) error

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

func (h Handler) Update(ctx echo.Context) error

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]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL