Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conf ¶
type Conf struct { Server serverConf Db dbConf Logger loggerConf }
Conf is the parent struct which holds the children configuration structs. Conf is used to keep config structs in isolated logical groups.
func AppConfig ¶
func AppConfig() *Conf
AppConfig runs the setup and install of the applications' configuration variables AppConfig is called wherever the config data is required.
Example ¶
type exampleStruct struct { String string `env:"STRING"` } os.Setenv("STRING", "an example string!") var e exampleStruct err := envdecode.StrictDecode(&e) if err != nil { panic(err) } // if STRING is set, e.String will contain its value fmt.Println(e.String)
Output: an example string!
Click to show internal directories.
Click to hide internal directories.