Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
LoadConfig loads a configuration from a byte slice into the given config. The config must be a pointer to a struct. It parses the byteslice as hujson, which allows for C-style comments and trailing commas on arrays and maps. It replaces any environment variables in the JSON string before unmarshalling, properly escaping values to maintain JSON structure. Finally, it unmarshals the JSON into the config struct.
Types ¶
type Helper ¶
type Helper interface {
Help() string
}
Helper is optionally implemented by Builder types to provide a human-readable description of their configuration. Used by CLI tools to show available config options in help output.
type Loader ¶
Loader is a struct which can dyanmically unmarshal any type T