Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleError ¶
HandleError Construct an HTTP error
Types ¶
type Error ¶
type Error struct { Code int `json:"code" example:"409"` Message string `json:"message" example:"Some Error"` }
Error struct
type SharingsAPI ¶
type SharingsAPI struct {
SharingsService Service.SharingsService
}
func InitSharingsAPI ¶
func InitSharingsAPI(db *mongo.Database) SharingsAPI
func (*SharingsAPI) GetSharing ¶
func (api *SharingsAPI) GetSharing(ctx echo.Context) error
GetSharing - Get sharing by hash (`/sharings/:hash`) @ID get-sharing-by-hash @Description Get sharing by hash @Produce json @Param hash path string true "Sharing hash" @Success 200 {object} dto.Sharing @Failure default {object} Error @Router /sharings/{hash} [get]
func (*SharingsAPI) InsertSharing ¶
func (api *SharingsAPI) InsertSharing(ctx echo.Context) error
InsertSharing - Insert sharing (`/sharings`) @ID insert-sharing @Description Inserts a new sharing @Accept json @Produce json @Param content body dto.CreateSharing_Params true "Shared content" @Success 200 {object} dto.Sharing @Failure default {object} Error @Router /sharings [post]
Click to show internal directories.
Click to hide internal directories.