mirror of https://github.com/statping/statping
25 lines
372 B
Go
25 lines
372 B
Go
package core
|
|
|
|
import (
|
|
"github.com/go-yaml/yaml"
|
|
"github.com/hunterlong/statup/types"
|
|
"io/ioutil"
|
|
)
|
|
|
|
type Config types.Config
|
|
|
|
var (
|
|
VERSION string
|
|
)
|
|
|
|
func LoadConfig() (*Config, error) {
|
|
var config Config
|
|
file, err := ioutil.ReadFile("config.yml")
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
err = yaml.Unmarshal(file, &config)
|
|
Configs = &config
|
|
return &config, err
|
|
}
|