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 Manifest(c echo.Context) 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 ManifestIcons
- type ManifestJSON
- type PersonOrAlbum
Constants ¶
This section is empty.
Variables ¶
var (
KioskVersion string
)
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 Manifest ¶ added in v0.15.0
func Manifest(c echo.Context) error
Manifest generates and returns a web app manifest JSON response based on the request referer URL. It sets appropriate headers and formats the manifest data according to the Web App Manifest spec.
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
Types ¶
type ManifestIcons ¶ added in v0.15.0
type ManifestIcons struct { Src string `json:"src"` // Path to the icon file Sizes string `json:"sizes"` // Dimensions of the icon Type string `json:"type"` // MIME type of the icon }
ManifestIcons represents the icon information in the web app manifest
type ManifestJSON ¶ added in v0.15.0
type ManifestJSON struct { Name string `json:"name"` // Full name of the web application ShortName string `json:"short_name"` // Short name for the app, used on home screens Description string `json:"description"` // Description of the web application StartURL string `json:"start_url"` // URL that loads when app is launched Scope string `json:"scope"` // Navigation scope that remains within the app Display string `json:"display"` // Preferred display mode for the website BackgroundColor string `json:"background_color"` // Background color for splash screen ThemeColor string `json:"theme_color"` // Theme color for the application Icons []ManifestIcons `json:"icons"` // Array of icons for different sizes }
ManifestJSON represents the JSON structure for a web app manifest