Documentation ¶
Index ¶
- Constants
- func Init()
- type RedisClient
- func (r *RedisClient) Bool(reply interface{}, err error) (bool, error)
- func (r *RedisClient) Bytes(reply interface{}, err error) ([]byte, error)
- func (r *RedisClient) Execute(cmd string, args ...interface{}) (interface{}, error)
- func (r *RedisClient) Float64(reply interface{}, err error) (float64, error)
- func (r *RedisClient) Int(reply interface{}, err error) (int, error)
- func (r *RedisClient) Int64(reply interface{}, err error) (int64, error)
- func (r *RedisClient) ReleaseOneRedisClient()
- func (r *RedisClient) Result(key string, reply interface{}, err error) *RedisResult
- func (r *RedisClient) Results(keys []string, reply interface{}, err error) *RedisResults
- func (r *RedisClient) String(reply interface{}, err error) (string, error)
- func (r *RedisClient) Strings(reply interface{}, err error) ([]string, error)
- func (r *RedisClient) Uint64(reply interface{}, err error) (uint64, error)
- type RedisLock
- type RedisResult
- func (r *RedisResult) As(data interface{}) error
- func (r *RedisResult) Bool() (bool, error)
- func (r *RedisResult) Bytes() ([]byte, error)
- func (r *RedisResult) Float64() (float64, error)
- func (r *RedisResult) Int() (int, error)
- func (r *RedisResult) Int64() (int64, error)
- func (r *RedisResult) String() (string, error)
- func (r *RedisResult) Strings() ([]string, error)
- func (r *RedisResult) Uint64() (uint64, error)
- type RedisResults
- type RedisStorage
- func (s *RedisStorage) Lock(key string)
- func (s *RedisStorage) ReenLock(key string)
- func (s *RedisStorage) Restore(key string) *RedisResult
- func (s *RedisStorage) RestoreHash(key string) *RedisResult
- func (s *RedisStorage) RestoreHashValue(key string, hashKey string) *RedisResult
- func (s *RedisStorage) RestoreKeys(keys []string) *RedisResults
- func (s *RedisStorage) RestoreList(key string) *RedisResult
- func (s *RedisStorage) RestoreListHead(key string) *RedisResult
- func (s *RedisStorage) RestoreListTail(key string) *RedisResult
- func (s *RedisStorage) RestoreSet(key string) *RedisResult
- func (s *RedisStorage) RestoreSets(keys []string) *RedisResult
- func (s *RedisStorage) RestoreZSet(key string) *RedisResult
- func (s *RedisStorage) Store(key string, value interface{}) error
- func (s *RedisStorage) StoreAsString(key string, value interface{}) error
- func (s *RedisStorage) StoreAsStringDuration(key string, value interface{}, duration time.Duration) error
- func (s *RedisStorage) StoreAsStringDurationIfAbsent(key string, value interface{}, duration time.Duration) (string, error)
- func (s *RedisStorage) StoreAsStringExpire(key string, value interface{}, expireTime time.Time) error
- func (s *RedisStorage) StoreAsStringIfAbsent(key string, value interface{}) (string, error)
- func (s *RedisStorage) StoreDuration(key string, value interface{}, duration time.Duration) error
- func (s *RedisStorage) StoreDurationIfAbsent(key string, value interface{}, duration time.Duration) (string, error)
- func (s *RedisStorage) StoreExpire(key string, value interface{}, expireTime time.Time) error
- func (s *RedisStorage) StoreHashValue(key string, hashKey string, value interface{}) (int, error)
- func (s *RedisStorage) StoreHashValueAsString(key string, value interface{}) (int, error)
- func (s *RedisStorage) StoreHashValues(key string, values map[string]interface{}) (int, error)
- func (s *RedisStorage) StoreHashValuesAsString(key string, values map[string]interface{}) (int, error)
- func (s *RedisStorage) StoreIfAbsent(key string, value interface{}) (string, error)
- func (s *RedisStorage) StoreListValue(key string, value interface{}) (int, error)
- func (s *RedisStorage) StoreListValueAsString(key string, value interface{}) (int, error)
- func (s *RedisStorage) StoreListValueHead(key string, value interface{}) (int, error)
- func (s *RedisStorage) StoreListValueHeadAsString(key string, value interface{}) (int, error)
- func (s *RedisStorage) StoreListValueTail(key string, value interface{}) (int, error)
- func (s *RedisStorage) StoreListValueTailAsString(key string, value interface{}) (int, error)
- func (s *RedisStorage) StoreListValues(key string, values []interface{}) (int, error)
- func (s *RedisStorage) StoreListValuesAsString(key string, values []interface{}) (int, error)
- func (s *RedisStorage) StoreSetValue(key string, value interface{}) (int, error)
- func (s *RedisStorage) StoreSetValueAsString(key string, value interface{}) (int, error)
- func (s *RedisStorage) StoreSetValues(key string, values []interface{}) (int, error)
- func (s *RedisStorage) StoreSetValuesAsString(key string, values []interface{}) (int, error)
- func (s *RedisStorage) StoreZSetValue(key string, score int, value interface{}) (int, error)
- func (s *RedisStorage) StoreZSetValueAsString(key string, score int, value interface{}) (int, error)
- func (s *RedisStorage) TryLock(key string) bool
- func (s *RedisStorage) TryReenLock(key string) bool
- func (s *RedisStorage) Unlock(key string)
Constants ¶
View Source
const ( //redis部分 ErrorsRedisInitConnFail string = "初始化redis连接池失败" ErrorsRedisAuthFail string = "Redis Auth 鉴权失败,密码错误" ErrorsRedisGetConnFail string = "Redis 从连接池获取一个连接失败,超过最大重试次数" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RedisClient ¶
type RedisClient struct {
// contains filtered or unexported fields
}
定义一个redis客户端结构体
func GetOneRedisClientIndex ¶
func GetOneRedisClientIndex(databaseIndex int) *RedisClient
func (*RedisClient) Bool ¶
func (r *RedisClient) Bool(reply interface{}, err error) (bool, error)
bool 类型转换
func (*RedisClient) Bytes ¶
func (r *RedisClient) Bytes(reply interface{}, err error) ([]byte, error)
Bytes 类型转换
func (*RedisClient) Execute ¶
func (r *RedisClient) Execute(cmd string, args ...interface{}) (interface{}, error)
为redis-go 客户端封装统一操作函数入口
func (*RedisClient) Float64 ¶
func (r *RedisClient) Float64(reply interface{}, err error) (float64, error)
Float64 类型转换
func (*RedisClient) Int ¶
func (r *RedisClient) Int(reply interface{}, err error) (int, error)
int 类型转换
func (*RedisClient) Int64 ¶
func (r *RedisClient) Int64(reply interface{}, err error) (int64, error)
int64 类型转换
func (*RedisClient) Result ¶
func (r *RedisClient) Result(key string, reply interface{}, err error) *RedisResult
封装几个数据类型转换的函数
func (*RedisClient) Results ¶
func (r *RedisClient) Results(keys []string, reply interface{}, err error) *RedisResults
封装几个数据类型转换的函数
func (*RedisClient) String ¶
func (r *RedisClient) String(reply interface{}, err error) (string, error)
string 类型转换
type RedisLock ¶
type RedisLock struct { *RedisClient // contains filtered or unexported fields }
func NewRedisLock ¶
func NewRedisLock(client *RedisClient, key string) *RedisLock
type RedisResult ¶
type RedisResult struct {
// contains filtered or unexported fields
}
func (*RedisResult) As ¶
func (r *RedisResult) As(data interface{}) error
type RedisResults ¶
type RedisResults struct {
// contains filtered or unexported fields
}
func (*RedisResults) AsStringList ¶
func (rs *RedisResults) AsStringList() []string
func (*RedisResults) AsStringMap ¶
func (rs *RedisResults) AsStringMap() map[string]string
func (*RedisResults) List ¶
func (rs *RedisResults) List() []*RedisResult
func (*RedisResults) Map ¶
func (rs *RedisResults) Map() map[string]*RedisResult
type RedisStorage ¶
type RedisStorage struct { *RedisClient // contains filtered or unexported fields }
func NewRedisStorage ¶
func NewRedisStorage(database int) *RedisStorage
func (*RedisStorage) Lock ¶
func (s *RedisStorage) Lock(key string)
func (*RedisStorage) ReenLock ¶
func (s *RedisStorage) ReenLock(key string)
func (*RedisStorage) Restore ¶
func (s *RedisStorage) Restore(key string) *RedisResult
func (*RedisStorage) RestoreHash ¶
func (s *RedisStorage) RestoreHash(key string) *RedisResult
func (*RedisStorage) RestoreHashValue ¶
func (s *RedisStorage) RestoreHashValue(key string, hashKey string) *RedisResult
func (*RedisStorage) RestoreKeys ¶
func (s *RedisStorage) RestoreKeys(keys []string) *RedisResults
func (*RedisStorage) RestoreList ¶
func (s *RedisStorage) RestoreList(key string) *RedisResult
func (*RedisStorage) RestoreListHead ¶
func (s *RedisStorage) RestoreListHead(key string) *RedisResult
func (*RedisStorage) RestoreListTail ¶
func (s *RedisStorage) RestoreListTail(key string) *RedisResult
func (*RedisStorage) RestoreSet ¶
func (s *RedisStorage) RestoreSet(key string) *RedisResult
func (*RedisStorage) RestoreSets ¶
func (s *RedisStorage) RestoreSets(keys []string) *RedisResult
func (*RedisStorage) RestoreZSet ¶
func (s *RedisStorage) RestoreZSet(key string) *RedisResult
func (*RedisStorage) Store ¶
func (s *RedisStorage) Store(key string, value interface{}) error
func (*RedisStorage) StoreAsString ¶
func (s *RedisStorage) StoreAsString(key string, value interface{}) error
func (*RedisStorage) StoreAsStringDuration ¶
func (s *RedisStorage) StoreAsStringDuration(key string, value interface{}, duration time.Duration) error
func (*RedisStorage) StoreAsStringDurationIfAbsent ¶
func (*RedisStorage) StoreAsStringExpire ¶
func (s *RedisStorage) StoreAsStringExpire(key string, value interface{}, expireTime time.Time) error
func (*RedisStorage) StoreAsStringIfAbsent ¶
func (s *RedisStorage) StoreAsStringIfAbsent(key string, value interface{}) (string, error)
func (*RedisStorage) StoreDuration ¶
func (s *RedisStorage) StoreDuration(key string, value interface{}, duration time.Duration) error
func (*RedisStorage) StoreDurationIfAbsent ¶
func (*RedisStorage) StoreExpire ¶
func (s *RedisStorage) StoreExpire(key string, value interface{}, expireTime time.Time) error
func (*RedisStorage) StoreHashValue ¶
func (s *RedisStorage) StoreHashValue(key string, hashKey string, value interface{}) (int, error)
func (*RedisStorage) StoreHashValueAsString ¶
func (s *RedisStorage) StoreHashValueAsString(key string, value interface{}) (int, error)
func (*RedisStorage) StoreHashValues ¶
func (s *RedisStorage) StoreHashValues(key string, values map[string]interface{}) (int, error)
func (*RedisStorage) StoreHashValuesAsString ¶
func (s *RedisStorage) StoreHashValuesAsString(key string, values map[string]interface{}) (int, error)
func (*RedisStorage) StoreIfAbsent ¶
func (s *RedisStorage) StoreIfAbsent(key string, value interface{}) (string, error)
func (*RedisStorage) StoreListValue ¶
func (s *RedisStorage) StoreListValue(key string, value interface{}) (int, error)
func (*RedisStorage) StoreListValueAsString ¶
func (s *RedisStorage) StoreListValueAsString(key string, value interface{}) (int, error)
func (*RedisStorage) StoreListValueHead ¶
func (s *RedisStorage) StoreListValueHead(key string, value interface{}) (int, error)
func (*RedisStorage) StoreListValueHeadAsString ¶
func (s *RedisStorage) StoreListValueHeadAsString(key string, value interface{}) (int, error)
func (*RedisStorage) StoreListValueTail ¶
func (s *RedisStorage) StoreListValueTail(key string, value interface{}) (int, error)
func (*RedisStorage) StoreListValueTailAsString ¶
func (s *RedisStorage) StoreListValueTailAsString(key string, value interface{}) (int, error)
func (*RedisStorage) StoreListValues ¶
func (s *RedisStorage) StoreListValues(key string, values []interface{}) (int, error)
func (*RedisStorage) StoreListValuesAsString ¶
func (s *RedisStorage) StoreListValuesAsString(key string, values []interface{}) (int, error)
func (*RedisStorage) StoreSetValue ¶
func (s *RedisStorage) StoreSetValue(key string, value interface{}) (int, error)
func (*RedisStorage) StoreSetValueAsString ¶
func (s *RedisStorage) StoreSetValueAsString(key string, value interface{}) (int, error)
func (*RedisStorage) StoreSetValues ¶
func (s *RedisStorage) StoreSetValues(key string, values []interface{}) (int, error)
func (*RedisStorage) StoreSetValuesAsString ¶
func (s *RedisStorage) StoreSetValuesAsString(key string, values []interface{}) (int, error)
func (*RedisStorage) StoreZSetValue ¶
func (s *RedisStorage) StoreZSetValue(key string, score int, value interface{}) (int, error)
func (*RedisStorage) StoreZSetValueAsString ¶
func (s *RedisStorage) StoreZSetValueAsString(key string, score int, value interface{}) (int, error)
func (*RedisStorage) TryLock ¶
func (s *RedisStorage) TryLock(key string) bool
func (*RedisStorage) TryReenLock ¶
func (s *RedisStorage) TryReenLock(key string) bool
func (*RedisStorage) Unlock ¶
func (s *RedisStorage) Unlock(key string)
Click to show internal directories.
Click to hide internal directories.