Documentation
¶
Overview ¶
Package config resolves the API key and reads/writes the CLI config file.
Index ¶
Constants ¶
View Source
const EnvAPIKey = "DEMOGRAFIX_API_KEY"
EnvAPIKey is the environment variable consulted for the API key.
Variables ¶
View Source
var ErrNoAPIKey = errors.New("no API key configured; run `demografix login` or set DEMOGRAFIX_API_KEY")
ErrNoAPIKey is returned when no key is found in any source. The CLI has no keyless mode.
Functions ¶
func DefaultPath ¶
DefaultPath returns the config file path, honoring XDG_CONFIG_HOME and falling back to ~/.config on every platform.
Types ¶
type Config ¶
type Config struct {
APIKey string `toml:"api_key"`
}
Config is the on-disk CLI configuration.
Click to show internal directories.
Click to hide internal directories.