Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abbychau/cascadeenv
init and checks os env for a list of names against ENV variables/ENV file/AWS ParamStore
https://github.com/abbychau/cascadeenv
Last synced: 11 days ago
JSON representation
init and checks os env for a list of names against ENV variables/ENV file/AWS ParamStore
- Host: GitHub
- URL: https://github.com/abbychau/cascadeenv
- Owner: abbychau
- License: apache-2.0
- Created: 2020-08-11T02:58:31.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-12T08:03:41.000Z (almost 4 years ago)
- Last Synced: 2024-10-11T12:51:03.440Z (about 1 month ago)
- Language: Go
- Size: 15.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CascadeEnv
init and checks os env for a list of names against ENV variables/ENV file/AWS ParamStore# Usage
In the import block:
`import "github.com/abbychau/cascadeenv"`In main:
```go
//NewAWSSession makes an AWS session for dynamodb
func NewAWSSession() *session.Session {
return session.Must(session.NewSessionWithOptions(session.Options{
SharedConfigState: session.SharedConfigEnable,
}))
}func main() {
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}) //Pretty logger for dev, can remove this line to use json-logger for production uselog.Info().Msg("Booting...")
err := cascadeenv.InitEnvVar(
[]string{"HEALTH_CHECK_INTERVAL", "HEALTH_CHECK_MAX_CONSECUTIVE_ERROR", "SERVER_LISTEN", "USER_API_URL", "DB_USER", "DB_PASS", "DB_PROTOCOL", "DB_NAME"},
".ENV",
persistence.NewAWSSession(),
)
}
```