config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package config provides configuration management for epos-opensource, including platform-specific application data directory path and user-configurable settings. It determines the correct storage location based on the runtime OS:

  • macOS: $HOME/Library/Application Support/epos-opensource
  • Windows: %LOCALAPPDATA%/epos-opensource (falls back to %APPDATA%)
  • Linux & others: ${XDG_DATA_HOME:-$HOME/.local/share}/epos-opensource

GetPath returns the resolved directory path for storing application data. DefaultConfig returns the default configuration with sensible defaults.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigPath

func GetConfigPath() string

GetConfigPath returns the platform-specific config file path

func GetDataPath

func GetDataPath() string

GetDataPath returns the platform-specific application data directory path

func SaveConfig

func SaveConfig(cfg Config) error

SaveConfig saves the configuration to the config file

func ValidateConfig

func ValidateConfig(cfg Config) error

ValidateConfig validates the configuration

Types

type Config

type Config struct {
	TUI TUIConfig `yaml:"tui"`
}

Config represents the application configuration

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration

func LoadConfig

func LoadConfig() (Config, error)

LoadConfig loads the user configuration, falling back to defaults

type FilePickerMode

type FilePickerMode string

FilePickerMode represents the mode for file picker selection

const (
	FilePickerModeNative FilePickerMode = "native"
	FilePickerModeTUI    FilePickerMode = "tui"
)

type TUIConfig

type TUIConfig struct {
	OpenURLCommand       string         `yaml:"openURLCommand"`
	OpenDirectoryCommand string         `yaml:"openDirectoryCommand"`
	OpenFileCommand      string         `yaml:"openFileCommand"`
	FilePickerMode       FilePickerMode `yaml:"filePickerMode"`
}

TUIConfig holds TUI-specific configurations

Jump to

Keyboard shortcuts

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