sum7/warehost
sum7
/
warehost
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.
warehost/cmd/warehost-auth/config.go

24 lines
399 B
Go
Raw Permalink Normal View History

2016-11-24 23:58:03 +01:00
package main
import (
"io/ioutil"
"gopkg.in/yaml.v2"
)
// Config of warehost webserver
type Config struct {
Database string `yaml:"database"`
}
// ReadConfigFile reads a config models by path to a yml file
func ReadConfigFile(path string) *Config {
config := &Config{}
file, _ := ioutil.ReadFile(path)
err := yaml.Unmarshal(file, &config)
if err != nil {
panic(err)
2016-11-24 23:58:03 +01:00
}
return config
}