handler

package
v0.20.4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBlurHash added in v0.19.0

func CreateBlurHash(srcf io.Reader) (hash string, err error)

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]

func SaveBackgroundFile added in v0.19.0

func SaveBackgroundFile(s *xorm.Session, auth web.Auth, list *models.List, srcf io.ReadSeeker, filename string, filesize uint64) (err error)

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.

Jump to

Keyboard shortcuts

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