✨ encapsulate Redis base function
This commit is contained in:
19
config/conf_redis.go
Normal file
19
config/conf_redis.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package config
|
||||
|
||||
import "time"
|
||||
|
||||
type Redis struct {
|
||||
Host string `yaml:"host"`
|
||||
Port string `yaml:"port"`
|
||||
Password string `yaml:"password"`
|
||||
Db int `yaml:"db"`
|
||||
MaxActive int `yaml:"max-active"`
|
||||
MaxIdle int `yaml:"max-idle"`
|
||||
MinIdle int `yaml:"min-idle"`
|
||||
PoolSize int `yaml:"pool-size"`
|
||||
PoolTimeout time.Duration `yaml:"pool-timeout"`
|
||||
}
|
||||
|
||||
func (r *Redis) Addr() string {
|
||||
return r.Host + ":" + r.Port
|
||||
}
|
Reference in New Issue
Block a user