/configo

Get config value each environments

Primary LanguageGo

ushios/configo

Build Status Coverage Status

Get config value each environments

Install

go get github.com/ushios/config

Usage

sample.cfg:

[DEFAULT]
host: github.local

[dev]
host: dev.github.com

[prd]
host: github.com

execute:

 $ go-bindata -pkg config sample.cfg database.cfg

sample.go:

assetByte, _ := config.Asset("sample.cfg")
buffer := bytes.NewBuffer(assetByte)

c, err := configo.Instance(bufio.NewReader(buffer), "dev")

fmt.Println(c.String("host")) // dev.github.com

License

The source files are distributed under the Mozilla Public License, version 2.0, unless otherwise noted.
Please read the FAQ if you have further questions regarding the license.

Thanks