1
0

commented code

This commit is contained in:
2022-05-07 11:03:14 +02:00
parent 6bbae4da79
commit e8d5293911
5 changed files with 24 additions and 5 deletions

View File

@ -7,6 +7,7 @@ import (
"gopkg.in/yaml.v2"
)
// entity storing configuration values loaded from a yaml file
type Config struct {
Token string `yaml:"token"`
Name string `yaml:"name"`
@ -19,6 +20,7 @@ type Config struct {
} `yaml:"talkback"`
}
// loads the values from the yaml configuration file into the configuration register
func (c *Config) LoadConf() *Config {
yamlFile, err := ioutil.ReadFile("config.yaml")
if err != nil {
@ -31,4 +33,5 @@ func (c *Config) LoadConf() *Config {
return c
}
// global configuration register
var ConfigRegister Config