https://github.com/l-vitaly/goenv
Library for loading settings from environment variables
https://github.com/l-vitaly/goenv
code config configuration env environment environment-variables generator golang settings
Last synced: about 1 month ago
JSON representation
Library for loading settings from environment variables
- Host: GitHub
- URL: https://github.com/l-vitaly/goenv
- Owner: l-vitaly
- License: mit
- Created: 2017-08-01T08:07:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-22T13:22:34.000Z (almost 7 years ago)
- Last Synced: 2024-10-15T09:21:59.146Z (over 1 year ago)
- Topics: code, config, configuration, env, environment, environment-variables, generator, golang, settings
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go Env
### Example
[See](example/README.md)
#### Generate from env file
Install:
go get -u github.com/l-vitaly/goenv/cmd/envgen
To generate a config based on the environment variable file, run the following command:
`envgen `
- env_file - environment variable file
- prefix - this value will be removed from the field names of the structure and constants
You can also group the fields in the structure by separating them with `__` characters. For example, if the name of the environment variable is `DB__CONN_SRT`, then the result will be like this:
```golang
type Config {
Db {
ConnSrt string
}
}
```