handler

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 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 GetProjectBackground added in v0.21.0

func GetProjectBackground(c echo.Context) error

GetProjectBackground serves a previously set background from a project It has no knowledge of the provider that was responsible for setting the background. @Summary Get the project background @Description Get the project background of a specific project. **Returns json on error.** @tags project @Produce octet-stream @Param id path int true "Project ID" @Security JWTKeyAuth @Success 200 {file} blob "The project background file." @Failure 403 {object} models.Message "No access to this project." @Failure 404 {object} models.Message "The project does not exist." @Failure 500 {object} models.Message "Internal error" @Router /projects/{id}/background [get]

func RemoveProjectBackground added in v0.21.0

func RemoveProjectBackground(c echo.Context) error

RemoveProjectBackground removes a project background, no matter the background provider @Summary Remove a project background @Description Removes a previously set project background, regardless of the project provider used to set the background. It does not throw an error if the project does not have a background. @tags project @Produce json @Param id path int true "Project ID" @Security JWTKeyAuth @Success 200 {object} models.Project "The project" @Failure 403 {object} models.Message "No access to this project." @Failure 404 {object} models.Message "The project does not exist." @Failure 500 {object} models.Message "Internal error" @Router /projects/{id}/background [delete]

func SaveBackgroundFile added in v0.19.0

func SaveBackgroundFile(s *xorm.Session, auth web.Auth, project *models.Project, 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 project 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