common

package
v0.14.7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package common provides shared types and utilities for the immich-kiosk application

Index

Constants

This section is empty.

Variables

View Source
var (

	// shared context
	Context context.Context

	// SharedSecret stores the application-wide shared secret string
	SharedSecret string
)

Functions

func Initialize added in v0.14.4

func Initialize() error

Initialize sets up the application context and shared secret. It ensures initialization occurs only once using sync.Once. Returns any errors that occurred during initialization.

func InitializeSecret

func InitializeSecret() error

InitializeSecret generates and sets the shared secret used for application security. The shared secret is used for authenticating and validating requests between components. Generation occurs only once through sync.Once synchronization to prevent duplicate secrets. The generated secret is stored in the SharedSecret global variable. Returns an error if the secret generation process fails.

Types

type RouteRequestData

type RouteRequestData struct {
	RequestConfig config.Config // Configuration for the current request
	DeviceID      string        // Unique identifier for the device making the request
	RequestID     string        // Unique identifier for this specific request
	ClientName    string        // Name of the client making the request
}

RouteRequestData contains request metadata and configuration used across routes

type ViewData

type ViewData struct {
	KioskVersion  string          // KioskVersion contains the current build version of Kiosk
	DeviceID      string          // DeviceID contains the unique identifier for the device
	Images        []ViewImageData // Images contains the collection of images to display in view
	Queries       url.Values      // Queries contains the URL query parameters
	CustomCss     []byte          // CustomCss contains custom CSS styling as bytes
	config.Config                 // Config contains the instance configuration
}

ViewData contains all the data needed to render a view in the application

type ViewImageData

type ViewImageData struct {
	ImmichImage   immich.ImmichAsset // ImmichImage contains immich asset data
	ImageData     string             // ImageData contains the image as base64 data
	ImageBlurData string             // ImageBlurData contains the blurred image as base64 data
	ImageDate     string             // ImageDate contains the date of the image
}

ViewImageData contains the image data and metadata for displaying an image in the view

Jump to

Keyboard shortcuts

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