Documentation
¶
Index ¶
Constants ¶
const ( // Filename into which Config is serialized Filename = "config.yaml" // DefaultConfigPath is used in the unlikely event that // the user has no home directory (no ~), there is no // XDG_CONFIG_HOME set DefaultConfigPath = ".config/func" // DefaultLanguage is intentionaly undefined. DefaultLanguage = "" )
Variables ¶
This section is empty.
Functions ¶
func ConfigPath ¶
func ConfigPath() string
ConfigPath returns the full path at which to look for a config file.
func Path ¶
func Path() (path string)
Path is derived in the following order, from lowest to highest precedence. 1. The static default is DefaultConfigPath (./.config/func) 2. ~/.config/func if it exists (can be expanded: user has a home dir) 3. The value of $XDG_CONFIG_PATH/func if the environment variable exists. The path is created if it does not already exist.
Types ¶
type Config ¶
type Config struct { // Language Runtime Language string `yaml:"language"` // Confirm Prompts Confirm bool `yaml:"confirm"` }
func New ¶
func New() Config
New Config struct with all members set to static defaults. See NewDefaults for one which further takes into account the optional config file.
func NewDefault ¶
Creates a new config populated by global defaults as defined by the config file located in .Path() (the global func settings path, which is
usually ~/.config/func)