Read reads the configuration based on a filesystem path
(configPath string)
| 16 | |
| 17 | // Read reads the configuration based on a filesystem path |
| 18 | func Read(configPath string) (*Config, error) { |
| 19 | configFile, err := ioutil.ReadFile(configPath) |
| 20 | if nil != err { |
| 21 | return nil, fmt.Errorf("Could not read config file in %v", configPath) |
| 22 | } |
| 23 | |
| 24 | var config Config |
| 25 | json.Unmarshal(configFile, &config) |
| 26 | return &config, nil |
| 27 | } |
| 28 | |
| 29 | // Create creates the configuration by requesting from stdin |
| 30 | func Create(configPath string) (*Config, error) { |