Documentation
¶
Overview ¶
Package config loads rigo.toml and discovers the vault location.
Index ¶
Constants ¶
const ( DefaultOSDir = ".os" DefaultAbsDir = ".abs" DefaultTrashDir = ".trash" )
Default names of the special vault directories, overridable in rigo.toml via os_dir / abs_dir / trash_dir.
Variables ¶
This section is empty.
Functions ¶
func Discover ¶
Discover locates rigo.toml via the symlink at $XDG_CONFIG_HOME/rigo/rigo.toml (default ~/.config/rigo/rigo.toml) and derives the vault root from the symlink target. It returns the resolved config path and the vault root.
func ExpandHome ¶ added in v1.0.3
ExpandHome expands a leading ~ (alone, ~/, or ~\) to the user's home directory. Shells that do not expand ~ for external commands (PowerShell among them) pass it through literally, so rigo handles it itself. ~user forms pass through unchanged.
Types ¶
type Config ¶
type Config struct {
Dirs []string
Ignore []string
Distros []string
OSDir string
AbsDir string
TrashDir string
Tags map[string][]string
Groups map[string][]string
Include map[string][]string
Exclude map[string][]string
Secrets map[string]Secret
Volumes map[string]Volume
}
Config is the typed content of rigo.toml. Paths are kept as written (including any trailing slash); normalization against the vault tree happens at scan time.
type Edit ¶
type Edit struct {
// contains filtered or unexported fields
}
Edit performs format-preserving mutations on a rigo.toml: user comments, blank lines, and ordering survive a load/save round trip.
func OpenEdit ¶
OpenEdit parses the rigo.toml at path for editing. Pass the vault-side real path (the resolved config path), not the symlink.
func (*Edit) AppendItem ¶
AppendItem appends a string item to the array at key, creating the key (and its table section) when missing. key is either a top-level array key like ["dirs"] or a table entry like ["tags", "vim"].
func (*Edit) RemoveRefs ¶
RemoveRefs removes every array item equal to path (modulo a trailing slash) from dirs and from every array under [tags], [include], and [exclude]. Keys whose arrays become empty are kept. It returns the number of removed items.