Documentation ¶ Index ¶ type Redis func Init(Addr string, Password string, DB int, varNamePrefix string) (m *Redis) func (m *Redis) Close() error func (m *Redis) DoGet(args ...any) (any, error) func (m *Redis) DoSet(args ...any) error func (m *Redis) Get(name string) (string, error) func (m *Redis) InitRedisClient() func (m *Redis) Set(name string, value interface{}, expiration int64) error Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Redis ¶ type Redis struct { Client *redis.Client Options redis.Options VarNamePrefix string } func Init ¶ added in v1.7.0 func Init(Addr string, Password string, DB int, varNamePrefix string) (m *Redis) func (*Redis) Close ¶ added in v1.7.0 func (m *Redis) Close() error func (*Redis) DoGet ¶ func (m *Redis) DoGet(args ...any) (any, error) 获取变量 Do 模式 func (*Redis) DoSet ¶ func (m *Redis) DoSet(args ...any) error 设置变量 Do 模式 func (*Redis) Get ¶ func (m *Redis) Get(name string) (string, error) 获取变量 func (*Redis) InitRedisClient ¶ func (m *Redis) InitRedisClient() 初始化 redis 客户端 func (*Redis) Set ¶ func (m *Redis) Set(name string, value interface{}, expiration int64) error 设置变量 Source Files ¶ View all Source files redis.go Click to show internal directories. Click to hide internal directories.