config.go (view raw)
1package main
2
3import (
4 "github.com/BurntSushi/toml"
5)
6
7type Config struct {
8 DbURI string
9 FilesPath string
10 RootDomain string
11 SecretKey string
12}
13
14func getConfig(filename string) (Config, error) {
15 var config Config
16 // Attempt to overwrite defaults from file
17 _, err := toml.DecodeFile(filename, &config)
18 if err != nil {
19 return config, err
20 }
21 return config, nil
22}