feat: 新增访客拦截器
This commit is contained in:
@@ -20,6 +20,7 @@ type Config struct {
|
||||
Log LogConfig `mapstructure:"log"`
|
||||
MySQL MySQLConfig `mapstructure:"mysql"`
|
||||
Redis RedisConfig `mapstructure:"redis"`
|
||||
JWT JWTConfig `mapstructure:"jwt"`
|
||||
}
|
||||
|
||||
// ServerConfig represents server configuration
|
||||
@@ -73,6 +74,13 @@ type RedisConfig struct {
|
||||
WriteTimeout int `mapstructure:"write_timeout"` // seconds
|
||||
}
|
||||
|
||||
// JWTConfig represents jwt configuration
|
||||
type JWTConfig struct {
|
||||
Secret string `mapstructure:"secret"`
|
||||
Issuer string `mapstructure:"issuer"`
|
||||
Expires int `mapstructure:"expires"` // hours
|
||||
}
|
||||
|
||||
// Load loads configuration from environment variable CFG_PATH
|
||||
// Default path is config/config.yml
|
||||
func Load() (*Config, error) {
|
||||
|
||||
Reference in New Issue
Block a user