Documentation ¶
Index ¶
- Constants
- Variables
- func Delete(context *gin.Context, key string) error
- func Expire(context *gin.Context, key string, expire int64) error
- func Get(context context.Context, key string) (string, error)
- func GetBit(context *gin.Context, key string, offset int64) (int64, error)
- func Incr(context *gin.Context, key string) error
- func InitRedisByConf(conf *RedisConfig, env string)
- func ListAll(context *gin.Context, key string) ([]interface{}, error)
- func RedisSetup(ctx context.Context)
- func Set(ctx context.Context, key, val string, expire int64) error
- func SetBit(context *gin.Context, key string, val, offset int64) error
- func SetDefaultRedisConf(config *RedisConfig, env string)
- func SetV2(context *gin.Context, key, val string) error
- func Setup(ctx context.Context)
- func SetupByHost(host, password string)
- type RedisConfig
Constants ¶
View Source
const ( HostDev = "127.0.0.1:6379" PasswordDev = "123456" HostProd = "127.0.0.1:6379" PasswordProd = "123456" )
View Source
const ( RedisPoolMaxIdle = 100 RedisPoolMaxActive = 10000 RedisPoolIdleTimeout = 1 )
View Source
const ( EnvOffline = "offline" EnvOnline = "online" )
View Source
const ExpireTime = 300
Variables ¶
Functions ¶
func InitRedisByConf ¶
func InitRedisByConf(conf *RedisConfig, env string)
func RedisSetup ¶
func SetDefaultRedisConf ¶
func SetDefaultRedisConf(config *RedisConfig, env string)
func SetupByHost ¶
func SetupByHost(host, password string)
Types ¶
type RedisConfig ¶
type RedisConfig struct { RedisHost string RedisPassword string RedisPoolMaxIdle int RedisPoolMaxActive int RedisPoolIdleTimeout int }
func GetRedisConf ¶
func GetRedisConf(env string) (conf RedisConfig)
func GetRedisConfV2 ¶
func GetRedisConfV2() (redisConf RedisConfig)
Click to show internal directories.
Click to hide internal directories.