feat : update config
This commit is contained in:
1 parent
2b92b100e3
commit
7e12e55b56
5 files changed
+36
-38
No files matched your search
@@ -11,9 +11,7 @@ type Application struct {
|
||||
JwtSecret string
|
||||
Mode string
|
||||
DemoMsg string
|
||||
Domain string
|
||||
IsHttps bool
|
||||
Logger *Logger
|
||||
EnableDP bool
|
||||
}
|
||||
|
||||
func InitApplication(cfg *viper.Viper) *Application {
|
||||
@@ -26,14 +24,7 @@ func InitApplication(cfg *viper.Viper) *Application {
|
||||
JwtSecret: cfg.GetString("jwtSecret"),
|
||||
Mode: cfg.GetString("mode"),
|
||||
DemoMsg: cfg.GetString("demoMsg"),
|
||||
Domain: cfg.GetString("domain"),
|
||||
IsHttps: cfg.GetBool("ishttps"),
|
||||
Logger: &Logger{
|
||||
Path: cfg.GetString("logger.path"),
|
||||
Level: cfg.GetString("logger.level"),
|
||||
Stdout: cfg.GetBool("logger.stdout"),
|
||||
Enabled: cfg.GetBool("logger.enabled"),
|
||||
},
|
||||
EnableDP: cfg.GetBool("enabledp"),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,10 +38,3 @@ func portDefault(cfg *viper.Viper) string {
|
||||
}
|
||||
}
|
||||
|
||||
func isHttpsDefault(cfg *viper.Viper) bool {
|
||||
if cfg.GetString("ishttps") == "" || cfg.GetBool("ishttps") == false {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user