Documentation
¶
Overview ¶
Package config provides configuration and path management for OmniVault.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.5.0
type Config struct {
// AutoLockTimeout is the duration after which the vault auto-locks.
// Use time.Duration format (e.g., "15m", "1h").
AutoLockTimeout string `json:"auto_lock_timeout,omitempty"`
// DefaultFormat is the default output format (text, json, yaml, shell).
DefaultFormat string `json:"default_format,omitempty"`
// DefaultTags are applied to all new secrets.
DefaultTags map[string]string `json:"default_tags,omitempty"`
// ExpiryWarningDays is the number of days before expiry to show warnings.
ExpiryWarningDays int `json:"expiry_warning_days,omitempty"`
}
Config represents the user configuration for OmniVault.
func DefaultConfig ¶ added in v0.5.0
func DefaultConfig() *Config
DefaultConfig returns the default configuration.
func LoadConfig ¶ added in v0.5.0
LoadConfig loads the configuration from the config file. Returns default config if the file doesn't exist.
func LoadConfigFromFile ¶ added in v0.5.0
LoadConfigFromFile loads the configuration from a specific file.
func (*Config) GetAutoLockDuration ¶ added in v0.5.0
GetAutoLockDuration parses and returns the auto-lock timeout duration.
func (*Config) GetExpiryWarningDays ¶ added in v0.5.0
GetExpiryWarningDays returns the number of days for expiry warnings.
func (*Config) SaveToFile ¶ added in v0.5.0
SaveToFile writes the configuration to a specific file.
type Paths ¶
type Paths struct {
// ConfigDir is the base configuration directory.
ConfigDir string
// ConfigFile is the user configuration file.
ConfigFile string
// VaultFile is the encrypted vault data file.
VaultFile string
// MetaFile is the vault metadata file (salt, params).
MetaFile string
// SocketPath is the Unix socket path for the daemon (Unix only).
SocketPath string
// TCPAddr is the TCP address for the daemon (Windows only).
TCPAddr string
// PIDFile is the daemon PID file.
PIDFile string
// LogFile is the daemon log file.
LogFile string
}
Paths contains all file system paths used by OmniVault.
func GetPaths ¶
func GetPaths() *Paths
GetPaths returns the appropriate paths for the current platform.
func (*Paths) CleanupSocket ¶
CleanupSocket removes the socket file if it exists.
func (*Paths) EnsureConfigDir ¶
EnsureConfigDir creates the configuration directory if it doesn't exist.
func (*Paths) VaultExists ¶
VaultExists returns true if the vault file exists.