Documentation ¶
Index ¶
- Variables
- func Get(key string) any
- func GetBool(key string) bool
- func GetBoolDefault(key string, defaultValue bool) bool
- func GetDefault(key string, defaultValue any) any
- func GetFloat(key string) float64
- func GetFloatDefault(key string, defaultValue float64) float64
- func GetInt(key string) int
- func GetIntDefault(key string, defaultValue int) int
- func GetString(key string) string
- func GetStringDefault(key string, defaultValue string) string
- func HandleConfigArgs(args ConfigArgs) error
- func Has(key string) bool
- func InitLogging()
- func LoadFile(path string) error
- func LoadReader(reader io.Reader) error
- func LoadString(text string) error
- func Reset()
- func Set(key string, value any)
- type ConfigArgs
Constants ¶
This section is empty.
Variables ¶
View Source
var DEFAULT_CONFIG string
Functions ¶
func GetBoolDefault ¶
func GetDefault ¶
func GetFloatDefault ¶
func GetIntDefault ¶
func GetStringDefault ¶
func HandleConfigArgs ¶
func HandleConfigArgs(args ConfigArgs) error
func InitLogging ¶
func InitLogging()
func LoadReader ¶
Load data into the configuration. This will not clear out an existing configuration (so can load multiple files). If there are any key conflicts, the data loaded last will win. If you want to clear the config, use Reset().
Types ¶
type ConfigArgs ¶
type ConfigArgs struct { ConfigPath []string `help:"Path to config file to load." type:"existingfile"` Config map[string]string `help:"Config options."` }
A Kong-style struct for adding on all the config-related options to a CLI.
Click to show internal directories.
Click to hide internal directories.