genofire/hs_monolith
genofire
/
hs_monolith
Archived
1
0
Fork 0
This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
hs_monolith/models/config.go

28 lines
443 B
Go

package models
import (
"io/ioutil"
"github.com/influxdata/toml"
)
//Config the config File of this daemon
type Config struct {
WebserverBind string
}
// ReadConfigFile reads a config model from path of a yml file
func ReadConfigFile(path string) *Config {
config := &Config{}
file, err := ioutil.ReadFile(path)
if err != nil {
panic(err)
}
if err := toml.Unmarshal(file, config); err != nil {
panic(err)
}
return config
}