f302239ba3 | ||
---|---|---|
.. | ||
LICENSE.md | ||
README.md | ||
gonfigure.go | ||
gonfigure_suite_test.go | ||
gonfigure_test.go |
README.md
GO-N-FIGURE
Minimalistic configuration helper for your Go projects.
Example
var portProperty = gonfigure.NewEnvProperty("PORT", "8080")
var domainProperty = gonfigure.NewRequiredEnvProperty("DOMAIN")
type Config struct {
Port string
Domain string
}
func NewConfig() Config {
return Config{
Port: portProperty.Value(),
// If the $DOMAIN env variable is not set, this call will panic
Domain: domainProperty.Value(),
}
}