Documentation
¶
Overview ¶
Package config provides global application configuration management. This only contains CLI display preferences. All HTTP behavior settings are stored per-session in session config files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetViperDefaults ¶ added in v0.2.10
SetViperDefaults sets default values in a viper instance based on DefaultConfig. This should be used by cmd/root.go to avoid duplicating default values.
Types ¶
type Config ¶
type Config struct {
// Display settings (CLI preferences)
PreviewOption string `json:"previewOption" mapstructure:"previewOption"` // full, headers, body, exchange
ShowColors bool `json:"showColors" mapstructure:"showColors"`
// contains filtered or unexported fields
}
Config represents the global application configuration. This only contains CLI display preferences. All HTTP behavior settings are stored per-session in session config files.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a new config with default values
func LoadConfig ¶
LoadConfig loads configuration from the default path using Viper
func LoadConfigFromDir ¶
LoadConfigFromDir loads configuration from a specific directory using Viper
func LoadConfigFromFile ¶
LoadConfigFromFile loads configuration from a specific file path
func LoadOrCreateConfig ¶
LoadOrCreateConfig loads existing config or creates a new one with defaults
func (*Config) ExportToJSON ¶
ExportToJSON exports the config as JSON string
func (*Config) WatchConfig ¶
func (c *Config) WatchConfig(onChange func())
WatchConfig enables live config reloading