koding / multiconfig

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

Allow configuration to be specified as an io.Reader #25

Closed jszwedko closed 9 years ago

jszwedko commented 9 years ago

Rather than just a path on disk

This allows for things like reading the configuration from STDIN

First of all, awesome package! I like that you put composability first.

I'm not super crazy about the implementation of this PR, but the existing structs are very centered around reading from files so I'm not sure what the best way to handle adding something like this is. If you are open to changing the interface of the package, I'd recommend centering the API around io.Readers and adding helper functions for dealing with files.

Anyway, I just wanted to get your thoughts about adding something like this to the package.

fatih commented 9 years ago

Hi @jszwedko. Thanks for the PR. Adding io.Reader support is good one. I'll going to review it soon. Eventually we can later add new constructors for TOML and JSON loaders to make it a little more easier to use this package.

jszwedko commented 9 years ago

@fatih Added two commits addressing your comments, let me know what you think!

fatih commented 9 years ago

LGTM :+1: