Skip to main content

Module config

Module config 

Source
Expand description

Configuration file management for gor.

Reads and writes ~/.config/gor/config.yml (mode 0600). Supports host-scoped keys via a top-level hosts map.

Structs§

GorConfig
Top-level configuration structure stored in ~/.config/gor/config.yml.

Enums§

ConfigError
Errors that can occur during config file operations.

Constants§

SUPPORTED_KEYS
Supported top-level config keys and their validation rules.

Functions§

config_path
Returns the path to the config file: ~/.config/gor/config.yml.
get
Get a config value, checking host-scoped overrides first.
load
Load the config from disk. Returns a default empty config if the file does not exist.
save
Save the config to disk, creating parent directories and setting mode 0600.
set
Set a config value. If host is provided, sets it under hosts.<host>.<key>.
validate
Validate a config key and value combination.