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 Loader ¶
Loader is a struct which can dyanmically unmarshal any type T
func (Loader[T]) MarshalJSON ¶
func (*Loader[T]) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.