Allow more customizability with config

This commit is contained in:
Jacob Gunther
2022-03-11 13:43:01 -06:00
parent 16d5c9689e
commit 061779f6f3
17 changed files with 206 additions and 103 deletions

View File

@@ -1,24 +0,0 @@
package main
import (
"io/ioutil"
"gopkg.in/yaml.v2"
)
type Configuration struct {
Redis struct {
URI string `yaml:"uri"`
Database int `yaml:"database"`
} `yaml:"redis"`
}
func (c *Configuration) ReadFile(file string) error {
data, err := ioutil.ReadFile(file)
if err != nil {
return err
}
return yaml.Unmarshal(data, c)
}