Documentation ¶
Index ¶
Constants ¶
View Source
const ( // 默认连接池超过 10 s 释放连接 DefaultIdleTimeoutSeconds = 10 // 默认最大激活连接数 DefaultMaxActive = 100 // 默认最大空闲连接数 DefaultMaxIdle = 20 )
Variables ¶
View Source
var ( // 添加任务 lua 脚本 //go:embed lua/add_task.lua AddTaskLuaScript string // 删除任务 lua 脚本 //go:embed lua/delete_task.lua DeleteTaskLuaScript string // 取任务 lua 脚本 //go:embed lua/range_tasks.lua RangeTasksLuaScript string )
Functions ¶
func RepairClient ¶
func RepairClient(c *ClientOptions)
Types ¶
type ClientOption ¶
type ClientOption func(c *ClientOptions)
func WithDB ¶
func WithDB(db int) ClientOption
func WithIdleTimeoutSeconds ¶
func WithIdleTimeoutSeconds(idleTimeoutSeconds int) ClientOption
func WithMaxActive ¶
func WithMaxActive(maxActive int) ClientOption
func WithMaxIdle ¶
func WithMaxIdle(maxIdle int) ClientOption
func WithWaitMode ¶
func WithWaitMode() ClientOption
type ClientOptions ¶
type Store ¶
type Store interface { // redis sadd 命令格式:SADD key member [member ...] SAdd(ctx context.Context, key, val string) (int, error) // redis EVAL 命令格式: EVAL script numkeys [key [key ...]] [arg [arg ...]] // numkeys 参数通过len(keys) 自动计算 Eval(ctx context.Context, src string, keys []string, args []interface{}) (interface{}, error) }
Store 表示 redis 存储接口
Click to show internal directories.
Click to hide internal directories.