add support for toml configuration file

This commit is contained in:
Thomas Preisner 2018-09-22 01:38:40 +02:00
parent 2e90d32ce2
commit fb43d8da3a
2 changed files with 22 additions and 10 deletions

12
main.go
View file

@ -2,9 +2,21 @@ package main
import (
"net/http"
"github.com/BurntSushi/toml"
)
type tomlConfig struct {
Database databaseConfig
}
var config tomlConfig
func main() {
_, err := toml.DecodeFile("config.toml", &config)
if err != nil {
panic(err)
}
db, err := prepareDatabase()
if err != nil {
panic(err)