koding / multiconfig

Load configuration from multiple sources in Go
http://godoc.org/github.com/koding/multiconfig
MIT License
454 stars 64 forks source link

Add default values support via new TagLoader, closes #3 #11

Closed fatih closed 10 years ago

fatih commented 10 years ago

This PR introduces a new TagLoader struct that satisfies the Loader interface. This is pluggable so people can use with other loaders to create their own custom multi loaders. However for our DefaultLoader its enabled by default. The DefaultLoader is now a multi loader which loads in the order of

Name string `default:"koding"`

The tag key name default can be changed if wished and configurable. I also improved the examples so each example is self contained (showing the struct itself) and introduced a new example for DefaultLoader

cihangir commented 10 years ago

Thanks.