Skip to content

Go Config hydrator from multiple sources

License

Notifications You must be signed in to change notification settings

JoelPagliuca/Conman

Repository files navigation

Conman

+ Tag a config to remind them to stay hydrated

Godoc reference GitHub go.mod Go version GitHub tag (latest SemVer)

Quickstart

import "github.com/JoelPagliuca/conman"

var myAppConfig struct {
	Port string `cmenv:"PORT" cmdefault:"8080"`
}

func init() {
	cm, _ := conman.New()
	cm.Hydrate(&myAppConfig)
}

This will try to set myAppConfig.Port to:

  • your PORT environment variable if it is set
  • then default to 8080

Check the godoc for more

Shout out to Marcus for the project name ❤️

About

Go Config hydrator from multiple sources

Resources

License

Stars

Watchers

Forks

Packages

No packages published