Merge pull request #1120 from donny-dont/features/remove-toml-config

Removing toml config
This commit is contained in:
Brad Rydzewski 2015-08-04 11:47:57 -07:00
commit 5a3fa1a047
2 changed files with 5 additions and 15 deletions

View file

@ -34,14 +34,13 @@ var (
) )
var ( var (
conf = flag.String("config", "drone.toml", "")
debug = flag.Bool("debug", false, "") debug = flag.Bool("debug", false, "")
) )
func main() { func main() {
flag.Parse() flag.Parse()
settings, err := config.Load(*conf) settings, err := config.Load()
if err != nil { if err != nil {
panic(err) panic(err)
} }
@ -55,6 +54,7 @@ func main() {
if err != nil { if err != nil {
panic(err) panic(err)
} }
session := session.New(settings) session := session.New(settings)
eventbus_ := eventbus.New() eventbus_ := eventbus.New()
queue_ := queue.New() queue_ := queue.New()

View file

@ -93,20 +93,10 @@ type Config struct {
} }
} }
// Load loads the configuration file and reads // Load loads the configuration from environment
// parameters from environment variables. // variables.
func Load(path string) (*Config, error) { func Load() (*Config, error) {
return LoadBytes([]byte{})
}
// LoadBytes reads the configuration file and
// reads parameters from environment variables.
func LoadBytes(data []byte) (*Config, error) {
conf := &Config{} conf := &Config{}
// err := toml.Unmarshal(data, conf)
// if err != nil {
// return nil, err
// }
err := envconfig.Init(conf) err := envconfig.Init(conf)
if err != nil { if err != nil {
return nil, err return nil, err