diff options
Diffstat (limited to 'src/conf')
| -rw-r--r-- | src/conf/conf.go | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/conf/conf.go b/src/conf/conf.go index d135fcb..03b3d33 100644 --- a/src/conf/conf.go +++ b/src/conf/conf.go @@ -3,14 +3,27 @@ package conf import ( "log" "os" + "github.com/BurntSushi/toml" ) -type Conf struct { - DbAdapter string `toml:"DB_ADAPTER"` - DbUser string `toml:"DB_USER"` - DbPassword string `toml:"DB_PASS"` -} +type ( + Conf struct { + Db Db + Server Server + } + + Db struct { + Adapter string `toml:"DB_ADAPTER"` + User string `toml:"DB_USER"` + Password string `toml:"DB_PASS"` + } + + Server struct { + Hostname string `toml:"SERVER_HOSTNAME"` + Port string `toml:"SERVER_PORT"` + } +) func Load() *Conf { @@ -29,7 +42,7 @@ func Load() *Conf { if err != nil { log.Fatalln(err) } - log.Println(c.DbAdapter) + log.Println(c.Db.Adapter) return &c } |
