redis

package
v0.0.0-...-4cd9d19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetService

func GetService() core.IService

func OnInit

func OnInit(s core.IService, opt ...Option) (err error)

Types

type Option

type Option func(*Options)

func RedisUrl

func RedisUrl(v string) Option

type Options

type Options struct {
	RedisUrl string
}

type RMutexOption

type RMutexOption func(*RMutexOptions)

func SetExpiry

func SetExpiry(v int) RMutexOption

func Setdelay

func Setdelay(v time.Duration) RMutexOption

type RMutexOptions

type RMutexOptions struct {
	// contains filtered or unexported fields
}

type RedisFactory

type RedisFactory struct {
	// contains filtered or unexported fields
}

func (RedisFactory) CloseAllPool

func (this RedisFactory) CloseAllPool()

func (RedisFactory) GetPool

func (this RedisFactory) GetPool(url string) *RedisPool

type RedisMutex

type RedisMutex struct {
	// contains filtered or unexported fields
}

func NewRedisMutex

func NewRedisMutex(key string, opt ...RMutexOption) *RedisMutex

func (*RedisMutex) Lock

func (this *RedisMutex) Lock() (err error)

此接口未阻塞接口

func (*RedisMutex) Unlock

func (this *RedisMutex) Unlock()

type RedisPool

type RedisPool struct {
	Pool *redis.Pool
}

func GetPool

func GetPool() *RedisPool

func NewRedisPool

func NewRedisPool(pool *redis.Pool) *RedisPool

func (*RedisPool) ContainsKey

func (this *RedisPool) ContainsKey(_Key string) bool

判断键是否存在

func (*RedisPool) ContainsKey_Map

func (this *RedisPool) ContainsKey_Map(_Key string, _FieldKey string) bool

判断键是否存在 Map中

func (*RedisPool) CustomFunc

func (this *RedisPool) CustomFunc(f func(pool redis.Conn))

自定义处理方法

func (*RedisPool) DelKey_MapKey

func (this *RedisPool) DelKey_MapKey(_Key string, _FieldKey string)

删除键值 哈希表 字段

func (*RedisPool) Delete

func (this *RedisPool) Delete(_Key string)

删除Redis 缓存键数据

func (*RedisPool) GetKey_List

func (this *RedisPool) GetKey_List(_Key string, _Vakue_type reflect.Type) (Value []interface{})

读取键值列表

func (*RedisPool) GetKey_Map

func (this *RedisPool) GetKey_Map(_Key string, _Vakue_type reflect.Type) (Value map[string]interface{})

读取键值 哈希表

func (*RedisPool) GetKey_MapByKey

func (this *RedisPool) GetKey_MapByKey(key string, fieldkey string, value interface{}) (err error)

读取键值 哈希表_key 值

func (*RedisPool) GetKey_MapByKeys

func (this *RedisPool) GetKey_MapByKeys(_Key string) (keys []string, err error)

func (*RedisPool) GetKey_MapByLen

func (this *RedisPool) GetKey_MapByLen(_Key string) (count int, err error)

func (*RedisPool) GetKey_MapByValues

func (this *RedisPool) GetKey_MapByValues(_Key string, _Vakue_type reflect.Type) (Values []interface{})

func (*RedisPool) GetKey_Value

func (this *RedisPool) GetKey_Value(_Key string, _Value interface{}) (err error)

添加键值对

func (*RedisPool) Lock

func (this *RedisPool) Lock(_Key string, outTime int) (err error)

func (*RedisPool) SetExKey_Map

func (this *RedisPool) SetExKey_Map(_Key string, _Value map[string]interface{})

添加键值 哈希表

func (*RedisPool) SetExKey_Value

func (this *RedisPool) SetExKey_Value(_Key string, _Value interface{}, expire int)

添加过期键值对

func (*RedisPool) SetKey_List

func (this *RedisPool) SetKey_List(_Key string, _Value []interface{})

添加键值列表

func (*RedisPool) SetKey_Map

func (this *RedisPool) SetKey_Map(_Key string, _Value map[string]interface{})

添加键值 哈希表

func (*RedisPool) SetKey_Value

func (this *RedisPool) SetKey_Value(_Key string, _Value interface{})

添加键值对

func (*RedisPool) UnLock

func (this *RedisPool) UnLock(_Key string) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL