Files
x_admin/server/config/redis.go
2025-07-28 20:14:46 +08:00

19 lines
704 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package config
type redisConfig struct {
Url string `mapstructure:"URL"` // Redis源配置: redis://:@127.0.0.1:6379/0
PoolSize int `mapstructure:"POOL_SIZE"` // Redis连接池大小
MaxIdleConns int `mapstructure:"MAX_IDLE_CONNS"` // Redis空闲连接池最大值
ConnMaxLifetime int `mapstructure:"CONN_MAX_LIFETIME"` // Redis连接可复用的最大时间(秒默认60秒)
RedisPrefix string `mapstructure:"REDIS_PREFIX"` // Redis键前缀: x:
}
var RedisConfig = redisConfig{
Url: "redis://:@127.0.0.1:6379/0",
PoolSize: 100,
MaxIdleConns: 10,
ConnMaxLifetime: 60,
// 默认x:
RedisPrefix: "x:",
}