Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { MyInt int `json:"myInt" envvar:"MY_INT"` MyFloat float32 `json:"myFloat" envvar:"MY_FLOAT"` MyString string `json:"myString" envvar:"MY_STRING"` MyBool bool `json:"myBool" envvar:"MY_BOOL"` // contains filtered or unexported fields }
Config is an example struct usable by the cfgbuild package.
func New ¶
New will load the .env file env vars (if not already set) and then create and return a new Config based on the env vars.
func (*Config) CfgBuildInit ¶ added in v0.2.0
CfgBuildInit sets some default values in the config. It is called by cfgbuild.Builder.Build().
func (*Config) CfgBuildValidate ¶ added in v0.2.0
CfgBuildValidate can check that the certain set values are valid. It is called by cfgbuild.Builder.Build().
Click to show internal directories.
Click to hide internal directories.