Adds timezone to config

This commit is contained in:
Deepak Mallubhotla 2020-12-29 18:12:04 -06:00
parent 0c6f686ce5
commit b6a6c9375f
Signed by: deepak
GPG Key ID: 64BF53A3369104E7
3 changed files with 5 additions and 1 deletions

View File

@ -1,7 +1,7 @@
app:
environment: "devel"
port: 5151
timezone: Africa/Abidjan
db:
type: "aoeu"
host: "aeihn"

View File

@ -10,6 +10,7 @@ import (
type AppConfig struct {
Environment string
Port string
Timezone string
}
// DBConfig is the config for the DB connection.
@ -33,6 +34,7 @@ func createDefaultConf() *Conf {
App: AppConfig{
Environment: "local",
Port: "8080",
Timezone: "America/New_York",
},
Db: DBConfig{
Type: "postgres",

View File

@ -16,6 +16,7 @@ func TestSample(t *testing.T) {
appConf := conf.App
assert.Equal("devel", appConf.Environment)
assert.Equal("5151", appConf.Port)
assert.Equal("Africa/Abidjan", appConf.Timezone)
dbConf := conf.Db
assert.Equal("aoeu", dbConf.Type)
@ -35,6 +36,7 @@ func TestDefault(t *testing.T) {
appConf := conf.App
assert.Equal("missingfield", appConf.Environment)
assert.Equal("8080", appConf.Port)
assert.Equal("America/New_York", appConf.Timezone)
dbConf := conf.Db
assert.Equal("typical", dbConf.Type)