Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheDir ¶
func CacheDir() string
CacheDir returns the cache directory (~/.cache/notion/). Respects XDG_CACHE_HOME if set.
func ConfigDir ¶
func ConfigDir() string
ConfigDir returns the config directory (~/.config/notion/). Respects XDG_CONFIG_HOME if set.
func EnsureDirs ¶
func EnsureDirs() error
EnsureDirs creates config and cache directories if they don't exist. Directories are created with 0o700 permissions.
Types ¶
type Config ¶
type Config struct {
DefaultProfile string `toml:"default_profile"`
DefaultOutput string `toml:"default_output,omitempty"` // table|json|plain
CacheTTL Duration `toml:"cache_ttl"`
Verbose bool `toml:"verbose,omitempty"`
Profiles map[string]Profile `toml:"profiles"`
}
Config is the top-level configuration.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns config with sensible defaults.
func Load ¶
Load reads config from the default path. Returns default config if the file doesn't exist.
func (*Config) GetProfile ¶
GetProfile returns the named profile or an error if not found.
func (*Config) SetProfile ¶
SetProfile stores a profile by name.
type Duration ¶
Duration wraps time.Duration for TOML marshalling.
func (Duration) MarshalText ¶
func (*Duration) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.