Documentation ¶
Index ¶
- Constants
- func DefaultDir() (string, error)
- func Dirs() ([]string, error)
- func Find(filename string, dirs []string) (string, error)
- func GetDefault(section, key, defaultVal string, c Config) (string, error)
- func GetGlobalConfig(key, defaultVal string, c Config) (string, error)
- func IsSectionEnabled(section string, c Config) bool
- type ArrayConfig
- type Config
Constants ¶
View Source
const (
GlobalConfigSection = "global"
)
Variables ¶
This section is empty.
Functions ¶
func DefaultDir ¶
func GetDefault ¶
GetDefault gets a value from the config, with a default if it doesn't exist
func GetGlobalConfig ¶
GetGlobalConfig gets a value from the Environment, the global config or a default fallback value if neither exists. If the key is "test", "CARDIGANN_TEST" is checked in the environment
func IsSectionEnabled ¶
IsSectionEnabled returns true if a section has an enabled=true
Types ¶
type ArrayConfig ¶
func (ArrayConfig) Section ¶
func (a ArrayConfig) Section(section string) (map[string]string, error)
func (ArrayConfig) Sections ¶
func (a ArrayConfig) Sections() ([]string, error)
func (ArrayConfig) Set ¶
func (a ArrayConfig) Set(section, key, value string) error
Click to show internal directories.
Click to hide internal directories.