Documentation
¶
Index ¶
- func Error(c echo.Context, err interface{}) error
- func ErrorWithStatus(c echo.Context, status int, err interface{}) error
- func GetIntQueryParam(c echo.Context, param string) (int, error)
- func SetAPI(ee **echo.Echo) error
- func Stop() error
- func Success(c echo.Context, data map[string]interface{}) error
- func SuccessWithStatus(c echo.Context, status int, data map[string]interface{}) error
- type API
- func (api *API) DeleteID(c echo.Context) error
- func (api *API) Get(c echo.Context) error
- func (api *API) GetID(c echo.Context) error
- func (api *API) Middleware(power auth.UserPower) func(echo.HandlerFunc) echo.HandlerFunc
- func (api *API) Post(c echo.Context) error
- func (api *API) PostAuth(c echo.Context) error
- func (api *API) PutID(c echo.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorWithStatus ¶
ErrorWithStatus returns a json error with the given status
func GetIntQueryParam ¶
GetIntQueryParam returns a query param as a int
Types ¶
type API ¶
type API struct{}
API holds all api handlers
func (*API) DeleteID ¶
DeleteID handles delete requests with a id in it to soft delete the user of the given id
func (*API) Get ¶
Get handles get requests to respond with a list of users the user making the request must have power UserPowerAdmin or greater
func (*API) Middleware ¶
func (api *API) Middleware(power auth.UserPower) func(echo.HandlerFunc) echo.HandlerFunc
Middleware is a function that returns a function that returns a function that runs the function given in the first given function so the next function runs at the end of the last function
func (*API) Post ¶
Post handles post requests to create a new user the required fields are: [username, email and password]
Click to show internal directories.
Click to hide internal directories.