1
0
mirror of https://github.com/rancher/os.git synced 2025-07-08 04:18:38 +00:00
os/config/default.go

19 lines
345 B
Go
Raw Normal View History

2015-02-17 05:08:48 +00:00
package config
func NewConfig() *CloudConfig {
2015-08-20 14:20:51 +00:00
return ReadConfig(nil, OsConfigFile)
}
2015-08-20 14:20:51 +00:00
func ReadConfig(bytes []byte, files ...string) *CloudConfig {
if data, err := readConfig(bytes, files...); err == nil {
c := &CloudConfig{}
2015-08-20 14:20:51 +00:00
if err := c.merge(data); err != nil {
return nil
}
c.amendNils()
return c
} else {
return nil
2015-02-17 05:08:48 +00:00
}
}