settings

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel string

LogLevel represents the logging level as a string enum

const (
	LogLevelDebug LogLevel = "DEBUG"
	LogLevelInfo  LogLevel = "INFO"
	LogLevelWarn  LogLevel = "WARN"
	LogLevelError LogLevel = "ERROR"
)

func FromSlogLevel

func FromSlogLevel(level slog.Level) LogLevel

FromSlogLevel converts slog.Level to LogLevel

func ParseLogLevel

func ParseLogLevel(levelStr string) (LogLevel, error)

ParseLogLevel parses a string to LogLevel

func (LogLevel) ToSlogLevel

func (l LogLevel) ToSlogLevel() slog.Level

ToSlogLevel converts LogLevel to slog.Level

type Settings

type Settings struct {
	Autostart bool             `json:"autostart" mapstructure:"autostart"`
	Hotkeys   []SettingsHotkey `json:"hotkeys" mapstructure:"hotkeys"`
	LogLevel  LogLevel         `json:"logLevel" mapstructure:"logLevel"`
	Commands  SettingsCommands `json:"commands" mapstructure:"commands"`
	Disks     SettingsDisks    `json:"disks" mapstructure:"disks"`
	Media     SettingsMedia    `json:"media" mapstructure:"media"`
}

func Load

func Load() (*Settings, error)

func (*Settings) Save

func (cfg *Settings) Save() error

func (*Settings) Validate

func (cfg *Settings) Validate() error

Validate validates the settings structure

type SettingsCommandDefinition

type SettingsCommandDefinition struct {
	ID         string   `json:"id" mapstructure:"id"`
	Name       string   `json:"name" mapstructure:"name"`
	Command    string   `json:"command" mapstructure:"command"`
	WorkingDir string   `json:"workingDir" mapstructure:"workingDir"`
	Arguments  []string `json:"arguments" mapstructure:"arguments"`
}

type SettingsCommands

type SettingsCommands struct {
	Allowlist []SettingsCommandDefinition `json:"allowlist" mapstructure:"allowlist"`
}

type SettingsDisks

type SettingsDisks struct {
	AllowedSecondaryMountPoints []string `json:"allowedSecondaryMountPoints" mapstructure:"allowedSecondaryMountPoints"`
}

type SettingsHotkey

type SettingsHotkey struct {
	Name string `json:"name" mapstructure:"name"`
	Key  string `json:"key" mapstructure:"key"`
}

type SettingsMedia

type SettingsMedia struct {
	Directories []SettingsMediaDirectory `json:"directories" mapstructure:"directories"`
}

type SettingsMediaDirectory

type SettingsMediaDirectory struct {
	Name string `json:"name" mapstructure:"name"`
	Path string `json:"path" mapstructure:"path"`
}

Jump to

Keyboard shortcuts

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