stevenbooru/vendor/src/github.com/deiwin/gonfigure
Christine Dodrill f302239ba3 Add dependencies 2015-07-31 08:17:14 -07:00
..
LICENSE.md Add dependencies 2015-07-31 08:17:14 -07:00
README.md Add dependencies 2015-07-31 08:17:14 -07:00
gonfigure.go Add dependencies 2015-07-31 08:17:14 -07:00
gonfigure_suite_test.go Add dependencies 2015-07-31 08:17:14 -07:00
gonfigure_test.go Add dependencies 2015-07-31 08:17:14 -07:00

README.md

GO-N-FIGURE

GoDoc

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(),
  }
}