config

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyRuntimeDefaults

func ApplyRuntimeDefaults(cfg *RuntimeConfig, defaults RuntimeConfig)

func EnsureRuntimeDirs

func EnsureRuntimeDirs(cfg RuntimeConfig) error

func ExpandHome

func ExpandHome(path string) string

func LoadTOML

func LoadTOML(path string, dst any) error

func WriteTOML

func WriteTOML(path string, src any, perm os.FileMode) error

Types

type App

type App struct {
	Name          string
	ConfigEnv     string
	BaseDir       string
	LegacyBaseDir string
	PlatformDirs  bool
}

func (App) DefaultPaths

func (a App) DefaultPaths() (Paths, error)

func (App) DefaultRuntimeConfig

func (a App) DefaultRuntimeConfig() (RuntimeConfig, error)

func (App) LegacyPaths

func (a App) LegacyPaths() (Paths, bool, error)

func (App) Normalize

func (a App) Normalize() (App, error)

func (App) ResolveConfigPath

func (a App) ResolveConfigPath(flagPath string) (string, error)

type Paths

type Paths struct {
	BaseDir    string `toml:"base_dir" json:"base_dir"`
	ConfigPath string `toml:"config_path" json:"config_path"`
	DBPath     string `toml:"db_path" json:"db_path"`
	CacheDir   string `toml:"cache_dir" json:"cache_dir"`
	LogDir     string `toml:"log_dir" json:"log_dir"`
	ShareDir   string `toml:"share_dir" json:"share_dir"`
}

type RuntimeConfig

type RuntimeConfig struct {
	Version  int    `toml:"version" json:"version"`
	DBPath   string `toml:"db_path" json:"db_path"`
	CacheDir string `toml:"cache_dir" json:"cache_dir"`
	LogDir   string `toml:"log_dir" json:"log_dir"`
	ShareDir string `toml:"share_dir" json:"share_dir"`
}

type TokenDiagnostic

type TokenDiagnostic struct {
	Env     string `json:"env"`
	Present bool   `json:"present"`
	Source  string `json:"source,omitempty"`
}

func TokenDiagnosticForEnv

func TokenDiagnosticForEnv(env string) TokenDiagnostic

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL