api

package
v0.0.0-...-4c384aa Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPError

func HTTPError(ctx echo.Context, status int, msg string) error

HTTPError Construct an HTTP error

func HandleError

func HandleError(ctx echo.Context, err error) error

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]

Jump to

Keyboard shortcuts

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