created: jwt provider
This commit is contained in:
parent
7e5010ac78
commit
bc2038ef34
3 changed files with 139 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ package config
|
|||
type Config struct {
|
||||
AppConf AppConfig
|
||||
DBConf DatabaseConfig
|
||||
JWTConf JWTConfig
|
||||
}
|
||||
|
||||
type AppConfig struct {
|
||||
|
|
@ -23,6 +24,13 @@ type DatabaseConfig struct {
|
|||
LogLevel string
|
||||
}
|
||||
|
||||
type JWTConfig struct {
|
||||
Secret string
|
||||
Issuer string
|
||||
AccessExpire string
|
||||
RefreshExpire string
|
||||
}
|
||||
|
||||
func NewConfig() *Config {
|
||||
return &Config{
|
||||
AppConf: AppConfig{
|
||||
|
|
@ -42,5 +50,12 @@ func NewConfig() *Config {
|
|||
DBName: getEnv("DB_NAME", ""),
|
||||
LogLevel: getEnv("DB_LOGLEVEL", ""),
|
||||
},
|
||||
|
||||
JWTConf: JWTConfig{
|
||||
Secret: getEnv("JWT_SECRET", ""),
|
||||
Issuer: getEnv("JWT_ISSUER", ""),
|
||||
AccessExpire: getEnv("JWT_ACCESS_EXPIRE", ""),
|
||||
RefreshExpire: getEnv("JWT_REFRESH_EXPIRE", ""),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue