Adds timezone to config
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
app:
|
app:
|
||||||
environment: "devel"
|
environment: "devel"
|
||||||
port: 5151
|
port: 5151
|
||||||
|
timezone: Africa/Abidjan
|
||||||
db:
|
db:
|
||||||
type: "aoeu"
|
type: "aoeu"
|
||||||
host: "aeihn"
|
host: "aeihn"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import (
|
|||||||
type AppConfig struct {
|
type AppConfig struct {
|
||||||
Environment string
|
Environment string
|
||||||
Port string
|
Port string
|
||||||
|
Timezone string
|
||||||
}
|
}
|
||||||
|
|
||||||
// DBConfig is the config for the DB connection.
|
// DBConfig is the config for the DB connection.
|
||||||
@@ -33,6 +34,7 @@ func createDefaultConf() *Conf {
|
|||||||
App: AppConfig{
|
App: AppConfig{
|
||||||
Environment: "local",
|
Environment: "local",
|
||||||
Port: "8080",
|
Port: "8080",
|
||||||
|
Timezone: "America/New_York",
|
||||||
},
|
},
|
||||||
Db: DBConfig{
|
Db: DBConfig{
|
||||||
Type: "postgres",
|
Type: "postgres",
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ func TestSample(t *testing.T) {
|
|||||||
appConf := conf.App
|
appConf := conf.App
|
||||||
assert.Equal("devel", appConf.Environment)
|
assert.Equal("devel", appConf.Environment)
|
||||||
assert.Equal("5151", appConf.Port)
|
assert.Equal("5151", appConf.Port)
|
||||||
|
assert.Equal("Africa/Abidjan", appConf.Timezone)
|
||||||
|
|
||||||
dbConf := conf.Db
|
dbConf := conf.Db
|
||||||
assert.Equal("aoeu", dbConf.Type)
|
assert.Equal("aoeu", dbConf.Type)
|
||||||
@@ -35,6 +36,7 @@ func TestDefault(t *testing.T) {
|
|||||||
appConf := conf.App
|
appConf := conf.App
|
||||||
assert.Equal("missingfield", appConf.Environment)
|
assert.Equal("missingfield", appConf.Environment)
|
||||||
assert.Equal("8080", appConf.Port)
|
assert.Equal("8080", appConf.Port)
|
||||||
|
assert.Equal("America/New_York", appConf.Timezone)
|
||||||
|
|
||||||
dbConf := conf.Db
|
dbConf := conf.Db
|
||||||
assert.Equal("typical", dbConf.Type)
|
assert.Equal("typical", dbConf.Type)
|
||||||
|
|||||||
Reference in New Issue
Block a user