Documentation ¶
Overview ¶
Package routes provides HTTP endpoint handlers for the Kiosk application.
It includes functions for rendering pages, handling API requests, and managing caching of page data. This package is responsible for defining the web routes and their corresponding handler functions.
Index ¶
- Variables
- func Clock(baseConfig *config.Config) echo.HandlerFunc
- func DrawFaceOnImage(img image.Image, i *immich.ImmichAsset) image.Image
- func FlushCache(baseConfig *config.Config) echo.HandlerFunc
- func Home(baseConfig *config.Config) echo.HandlerFunc
- func InitializeRequestData(c echo.Context, baseConfig *config.Config) (*common.RouteRequestData, error)
- func NewImage(baseConfig *config.Config) echo.HandlerFunc
- func NewRawImage(baseConfig *config.Config) echo.HandlerFunc
- func PreviousImage(baseConfig *config.Config) echo.HandlerFunc
- func ProcessViewImageData(requestConfig config.Config, c echo.Context, isPrefetch bool) (common.ViewImageData, error)
- func ProcessViewImageDataWithRatio(imageOrientation immich.ImageOrientation, requestConfig config.Config, ...) (common.ViewImageData, error)
- func Redirect(baseConfig *config.Config) echo.HandlerFunc
- func RefreshCheck(baseConfig *config.Config) echo.HandlerFunc
- func Render(ctx echo.Context, statusCode int, t templ.Component) error
- func RenderError(c echo.Context, err error, message string) error
- func ShouldDrawFacesOnImages() bool
- func Sleep(baseConfig *config.Config) echo.HandlerFunc
- func Weather(baseConfig *config.Config) echo.HandlerFunc
- func Webhooks(baseConfig *config.Config) echo.HandlerFunc
- type PersonOrAlbum
Constants ¶
This section is empty.
Variables ¶
var ( KioskVersion string ViewDataCache *cache.Cache )
Functions ¶
func DrawFaceOnImage ¶
func FlushCache ¶
func InitializeRequestData ¶
func InitializeRequestData(c echo.Context, baseConfig *config.Config) (*common.RouteRequestData, error)
InitializeRequestData processes incoming request context and configuration to create RouteRequestData. It handles kiosk version checks, client configuration overrides, and request metadata.
Parameters:
- c: Echo context containing the HTTP request and response data
- baseConfig: Base configuration to be used as template for request-specific config
Returns:
- *common.RouteRequestData: Processed request data and configuration
- error: Any errors encountered during initialization
func NewImage ¶
NewImage returns an echo.HandlerFunc that handles requests for new images. It manages image processing, caching, and prefetching based on the configuration.
func NewRawImage ¶
NewRawImage returns an echo.HandlerFunc that handles requests for raw images. It processes the image without any additional transformations and returns it as a blob.
func PreviousImage ¶
PreviousImage returns an echo.HandlerFunc that handles requests for previous images. It retrieves the previous images from the history and renders them.
func ProcessViewImageData ¶
func ProcessViewImageDataWithRatio ¶
func ProcessViewImageDataWithRatio(imageOrientation immich.ImageOrientation, requestConfig config.Config, c echo.Context, isPrefetch bool) (common.ViewImageData, error)
func Redirect ¶
Redirect returns an echo.HandlerFunc that handles URL redirections based on configured redirect paths. It takes a baseConfig parameter containing the application configuration including redirect mappings.
If the requested redirect name exists in the RedirectsMap, it redirects to the mapped URL. Otherwise, it redirects to the root path "/".
The function returns a temporary (307) redirect in both cases.
func RefreshCheck ¶
RefreshCheck endpoint to check if device requires a refresh
func Render ¶
This custom Render replaces Echo's echo.Context.Render() with templ's templ.Component.Render().
func RenderError ¶
func ShouldDrawFacesOnImages ¶
func ShouldDrawFacesOnImages() bool