utils

package
v1.7.3-0...-caeaf44 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateStableUUID

func GenerateStableUUID(macAddress, hostname string) string

GenerateStableUUID creates a stable UUID based on system characteristics This ensures the same UUID is generated for the same system even if not persisted

func GenerateToken

func GenerateToken() string

func GetConfigPath

func GetConfigPath() (string, error)

GetConfigPath returns the path to the config directory

func GetDataPath

func GetDataPath() (string, error)

GetDataPath returns the path to the data directory

func GetLogFilePath

func GetLogFilePath(now time.Time) (string, error)

GetLogFilePath returns the path to the daily log file.

func GetLogsPath

func GetLogsPath() (string, error)

GetLogsPath returns the path to the logs directory.

func GetPort

func GetPort() int

GetPort returns the port from environment variable, defaulting to 9170

func GetSSDPPort

func GetSSDPPort() int

GetSSDPPort returns the SSDP port from environment variable, defaulting to 1900

func GetSystemUUID

func GetSystemUUID(biosUUID, macAddress, hostname string) string

GetSystemUUID gets the system UUID, using fallback logic for problematic default UUIDs biosUUID: The UUID read from BIOS/system macAddress: The system's MAC address (used for generating stable fallback) hostname: The system's hostname (used for generating stable fallback)

func GetTokenFilePath

func GetTokenFilePath() (string, error)

GetTokenFilePath returns the path to the token file

func GetUUIDFilePath

func GetUUIDFilePath() (string, error)

GetUUIDFilePath returns the path to the generated UUID file

func IsDefaultUUID

func IsDefaultUUID(uuidStr string) bool

IsDefaultUUID checks if the given UUID is a known problematic default value

func IsRunningFromRealBinary

func IsRunningFromRealBinary() bool

IsRunningFromRealBinary checks if the application is running from a real binary rather than from go run or wgo run

func LoadOrGenerateUUID

func LoadOrGenerateUUID(macAddress, hostname string) (string, error)

LoadOrGenerateUUID loads a previously generated UUID from file, or generates a new one Uses atomic file creation to prevent race conditions when multiple processes start simultaneously

func LoadToken

func LoadToken() (string, error)

LoadToken loads the API token from file, generating one if it doesn't exist

func SaveToken

func SaveToken(token string) error

SaveToken saves the API token to file

func SaveUUID

func SaveUUID(uuidStr string) error

SaveUUID saves the UUID to file

func SetHideWindow

func SetHideWindow(cmd *exec.Cmd)

func ValidateCommand

func ValidateCommand(id, name, command, workingDir string, arguments []string) error

ValidateCommand validates a command definition

func ValidateMediaDirectory

func ValidateMediaDirectory(path string) error

ValidateMediaDirectory validates a single media directory path

Types

This section is empty.

Directories

Path Synopsis
handlers

Jump to

Keyboard shortcuts

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