Documentation ¶
Index ¶
- func ArrayOfBytes(results interface{}, err error) ([][]byte, error)
- func ArrayOfInts(results interface{}, err error) ([]int, error)
- func ArrayOfStrings(results interface{}, err error) ([]string, error)
- func GetMembers(members []*ScoredMember) []string
- func Prefix(namespace string, keys []string) []string
- func PrefixStringsToInterfaces(prefix string, keys []string) []interface{}
- func ReadWriteHosts(hosts []*RedisHosts) (read []string, write []string)
- func StringsToInterfaces(keys []string) []interface{}
- type Client
- type KeyValueString
- type RedisCache
- func (r *RedisCache) Get(key string) (value string, err error)
- func (r *RedisCache) GetBytes(key string) (result []byte, err error)
- func (r *RedisCache) GetHashInt64(hashName string) (map[string]int64, error)
- func (r *RedisCache) GetObject(key string, instance interface{}) (miss bool, err error)
- func (r *RedisCache) Increment(hashName, fieldName string, by int) (int64, error)
- func (r *RedisCache) MGet(keys []string) (result []string, err error)
- func (r *RedisCache) MSet(kv []*KeyValueString) error
- func (r *RedisCache) Ping() error
- func (r *RedisCache) Read(command string, args ...interface{}) (interface{}, error)
- func (r *RedisCache) ReadInt64(command string, args ...interface{}) (int64, error)
- func (rc *RedisCache) SAdd(key string, items ...string) (int, error)
- func (s *RedisCache) SMembers(listKey string) ([]string, error)
- func (rc *RedisCache) SRandMember(key string, count int) ([]string, error)
- func (rc *RedisCache) SRem(key string, items ...string) (int, error)
- func (r *RedisCache) Set(key string, value string) error
- func (rc *RedisCache) SetAdd(key string, items []interface{}) (int, error)
- func (r *RedisCache) SetBytes(key string, bytes []byte) error
- func (r *RedisCache) SetNX(key string, value string) error
- func (s *RedisCache) SetRemove(listKey string, member []byte) (int, error)
- func (r *RedisCache) Write(command string, args ...interface{}) (interface{}, error)
- func (rc *RedisCache) ZAdd(key string, members ...*ScoredMember) (int, error)
- func (rc *RedisCache) ZCard(key string) (int, error)
- func (rc *RedisCache) ZIncrBy(key string, amount int, member string) (int, error)
- func (rc *RedisCache) ZRevRange(key string, start, stop int) ([]*ScoredMember, error)
- func (rc *RedisCache) ZRevRangeByScore(key string, max, min int) ([]*ScoredMember, error)
- func (rc *RedisCache) ZScore(key, member string) (*int, error)
- type RedisHosts
- type RedisSortedSetMock
- func (m *RedisSortedSetMock) ZAdd(key string, members []*ScoredMember) (int, error)
- func (m *RedisSortedSetMock) ZCard(key string) (int, error)
- func (m *RedisSortedSetMock) ZIncrBy(key string, amount int, member []byte) (int, error)
- func (m *RedisSortedSetMock) ZRevRange(key string, start, stop int) ([]*ScoredMember, error)
- func (rc *RedisSortedSetMock) ZRevRangeByScore(key string, max, min int) ([]*ScoredMember, error)
- type ScoredMember
- type Set
- type SetP
- type SortedSet
- type StringsCache
- type ZAddArgs
- type ZCardArgs
- type ZIncrByArgs
- type ZRevRangeArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayOfBytes ¶
func ArrayOfInts ¶
func ArrayOfStrings ¶
func GetMembers ¶
func GetMembers(members []*ScoredMember) []string
func ReadWriteHosts ¶
func ReadWriteHosts(hosts []*RedisHosts) (read []string, write []string)
func StringsToInterfaces ¶
func StringsToInterfaces(keys []string) []interface{}
Types ¶
type KeyValueString ¶
type RedisCache ¶
type RedisCache struct { Log logging.Logger `inject:""` Encoder func(v interface{}) ([]byte, error) Decoder func(data []byte, v interface{}) error // contains filtered or unexported fields }
func NewService ¶
func NewService(readUris []string, writeUris []string, hostPassword string) *RedisCache
NewRedisCache creates a new cache service connecting to the given hostUris and hostPassword. If there is no hostPassword, then pass an empty string.
func (*RedisCache) Get ¶
func (r *RedisCache) Get(key string) (value string, err error)
Get value from cache by key.
func (*RedisCache) GetHashInt64 ¶
func (r *RedisCache) GetHashInt64(hashName string) (map[string]int64, error)
func (*RedisCache) GetObject ¶
func (r *RedisCache) GetObject(key string, instance interface{}) (miss bool, err error)
func (*RedisCache) Increment ¶
func (r *RedisCache) Increment(hashName, fieldName string, by int) (int64, error)
func (*RedisCache) MSet ¶
func (r *RedisCache) MSet(kv []*KeyValueString) error
func (*RedisCache) Ping ¶
func (r *RedisCache) Ping() error
func (*RedisCache) Read ¶
func (r *RedisCache) Read(command string, args ...interface{}) (interface{}, error)
func (*RedisCache) ReadInt64 ¶
func (r *RedisCache) ReadInt64(command string, args ...interface{}) (int64, error)
func (*RedisCache) SAdd ¶
func (rc *RedisCache) SAdd(key string, items ...string) (int, error)
SAdd returns the number of items added to the set from the items given.
func (*RedisCache) SRandMember ¶
func (rc *RedisCache) SRandMember(key string, count int) ([]string, error)
func (*RedisCache) SRem ¶
func (rc *RedisCache) SRem(key string, items ...string) (int, error)
SRem returns the number items removed from the set
func (*RedisCache) SetAdd ¶
func (rc *RedisCache) SetAdd(key string, items []interface{}) (int, error)
SAdd returns the number of items added to the set from the items given.
func (*RedisCache) SetRemove ¶
func (s *RedisCache) SetRemove(listKey string, member []byte) (int, error)
func (*RedisCache) Write ¶
func (r *RedisCache) Write(command string, args ...interface{}) (interface{}, error)
func (*RedisCache) ZAdd ¶
func (rc *RedisCache) ZAdd(key string, members ...*ScoredMember) (int, error)
func (*RedisCache) ZCard ¶
func (rc *RedisCache) ZCard(key string) (int, error)
ZCard returns the Cardinality (i.e. count) of the set
func (*RedisCache) ZRevRange ¶
func (rc *RedisCache) ZRevRange(key string, start, stop int) ([]*ScoredMember, error)
ZRevRange returns a subset ordered in descending order
func (*RedisCache) ZRevRangeByScore ¶
func (rc *RedisCache) ZRevRangeByScore(key string, max, min int) ([]*ScoredMember, error)
type RedisHosts ¶
type RedisSortedSetMock ¶
type RedisSortedSetMock struct { ZAddArgs []*ZAddArgs ZRevRangeArgs []*ZRevRangeArgs ZIncrByArgs []*ZIncrByArgs ZCardArgs []*ZCardArgs }
func NewRedisSortedSetMock ¶
func NewRedisSortedSetMock() *RedisSortedSetMock
func (*RedisSortedSetMock) ZAdd ¶
func (m *RedisSortedSetMock) ZAdd(key string, members []*ScoredMember) (int, error)
func (*RedisSortedSetMock) ZCard ¶
func (m *RedisSortedSetMock) ZCard(key string) (int, error)
ZCard returns the Cardinality (i.e. count) of the set
func (*RedisSortedSetMock) ZRevRange ¶
func (m *RedisSortedSetMock) ZRevRange(key string, start, stop int) ([]*ScoredMember, error)
ZRevRange returns a subset ordered in descending order
func (*RedisSortedSetMock) ZRevRangeByScore ¶
func (rc *RedisSortedSetMock) ZRevRangeByScore(key string, max, min int) ([]*ScoredMember, error)
type ScoredMember ¶
type SortedSet ¶
type SortedSet interface { ZAdd(key string, members ...*ScoredMember) (int, error) // ZRevRange returns a subset ordered in descending order ZRevRange(key string, start, stop int) ([]*ScoredMember, error) ZRevRangeByScore(key string, max, min int) ([]*ScoredMember, error) ZIncrBy(key string, amount int, member string) (int, error) // ZCard returns the Cardinality (i.e. count) of the set ZCard(key string) (int, error) // ZSScore if the member or key does not exists return a nil int with no error ZScore(key, member string) (*int, error) }
type StringsCache ¶
type ZAddArgs ¶
type ZAddArgs struct { Key string Members []*ScoredMember }
type ZIncrByArgs ¶
type ZRevRangeArgs ¶
Click to show internal directories.
Click to hide internal directories.