Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetListBackground ¶
func GetListBackground(c echo.Context) error
GetListBackground serves a previously set background from a list It has no knowledge of the provider that was responsible for setting the background. @Summary Get the list background @Description Get the list background of a specific list. **Returns json on error.** @tags list @Produce octet-stream @Param id path int true "List ID" @Security JWTKeyAuth @Success 200 {} string "The list background file." @Failure 403 {object} models.Message "No access to this list." @Failure 404 {object} models.Message "The list does not exist." @Failure 500 {object} models.Message "Internal error" @Router /lists/{id}/background [get]
func RemoveListBackground ¶ added in v0.17.0
func RemoveListBackground(c echo.Context) error
RemoveListBackground removes a list background, no matter the background provider @Summary Remove a list background @Description Removes a previously set list background, regardless of the list provider used to set the background. It does not throw an error if the list does not have a background. @tags list @Produce json @Param id path int true "List ID" @Security JWTKeyAuth @Success 200 {object} models.List "The list" @Failure 403 {object} models.Message "No access to this list." @Failure 404 {object} models.Message "The list does not exist." @Failure 500 {object} models.Message "Internal error" @Router /lists/{id}/background [delete]
Types ¶
type BackgroundProvider ¶
type BackgroundProvider struct {
Provider func() background.Provider
}
BackgroundProvider represents a thing which holds a background provider Lets us get a new fresh provider every time we need one.
func (*BackgroundProvider) SearchBackgrounds ¶
func (bp *BackgroundProvider) SearchBackgrounds(c echo.Context) error
SearchBackgrounds is the web handler to search for backgrounds
func (*BackgroundProvider) SetBackground ¶
func (bp *BackgroundProvider) SetBackground(c echo.Context) error
SetBackground sets an Image as list background
func (*BackgroundProvider) UploadBackground ¶
func (bp *BackgroundProvider) UploadBackground(c echo.Context) error
UploadBackground uploads a background and passes the id of the uploaded file as an Image to the Set function of the BackgroundProvider.