Files
gocryptotrader/config.go
2015-03-03 21:50:16 +11:00

42 lines
567 B
Go

package main
import (
"io/ioutil"
"encoding/json"
)
type SMSContacts struct {
Name string
Number string
Enabled bool
}
type Config struct {
Name string
SMSContacts []SMSContacts
Exchanges []Exchanges
}
type Exchanges struct {
Name string
Enabled bool
Verbose bool
APIKey string
APISecret string
ClientID string
Pairs string
BaseCurrencies string
}
func ReadConfig(path string) (Config, error) {
file, err := ioutil.ReadFile(path)
if err != nil {
return Config{}, err
}
cfg := Config{}
err = json.Unmarshal(file, &cfg)
return cfg, err
}