config

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName             = "workfort"
	EnvPrefix           = "WORKFORT"
	UserConfigFileName  = "config"
	LocalConfigFileName = "workfort"
	ConfigType          = "yaml"
)

Variables

This section is empty.

Functions

func BindFlags

func BindFlags(flags *pflag.FlagSet) error

BindFlags binds application flags to Viper.

func GetLogLevel

func GetLogLevel() string

func GetUseTUI

func GetUseTUI() bool

func InitDirs

func InitDirs() error

func InitViper

func InitViper()

InitViper sets up Viper with defaults and environment variable support. Called once during application init(), before directories are created.

func LoadConfig

func LoadConfig() error

LoadConfig reads config files in precedence order. Precedence: ENV > ./workfort.yaml > ~/.config/workfort/config.yaml > defaults

func SaveSetting

func SaveSetting(key, value string) error

SaveSetting sets a key in viper and persists it to the user config file.

Types

type Paths

type Paths struct {
	ConfigDir string // XDG_CONFIG_HOME/workfort
	DataDir   string // XDG_DATA_HOME/workfort
	CacheDir  string // XDG_CACHE_HOME/workfort
}

Paths holds XDG-compliant directory paths.

var GlobalPaths *Paths

func GetPaths

func GetPaths() *Paths

Jump to

Keyboard shortcuts

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