Package Usage: go: github.com/meowgorithm/babyenv
Package babyenv collects environment variables and places them in
corresponding struct fields. It aims to reduce the boilerplate in reading
data from the environment.
The struct should contain `env` tags indicating the names of corresponding
environment variables. The values of those environment variables will be
then collected and placed into the struct. If nothing is found, struct
fields will be given their default values (for example, `bool`s will be
`false`).
Default values can also be provided in the `default` tag.
A 'required' flag can also be set in the following format:
If a required flag is set the 'default' tag will be ignored.
Only a few types are supported: string, bool, int, []byte, *string, *bool,
*int, *[]byte. An error will be returned if other types are attempted to
be processed.
Example:
6 versions
Latest release: over 4 years ago
58 dependent packages
View more package details: https://packages.ecosystem.code.gouv.fr/registries/proxy.golang.org/packages/github.com/meowgorithm/babyenv