Documentation ¶
Index ¶
- func IsNilErr(err error) bool
- type BoolResult
- type BoolSliceResult
- type Client
- type Commands
- type Config
- type DurationResult
- type FloatResult
- type IntResult
- type IntSliceResult
- type Option
- type Pipeliner
- type PubSub
- type Result
- type ScanResult
- type SliceResult
- type StatusResult
- type StringIntMapResult
- type StringResult
- type StringSliceResult
- type StringStringMapResult
- type StringStructMapResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoolResult ¶
type BoolResult interface { Val() bool Result() (bool, error) // contains filtered or unexported methods }
BoolResult the bool result for redis commands
type BoolSliceResult ¶
type BoolSliceResult interface { Val() []bool Result() ([]bool, error) // contains filtered or unexported methods }
BoolSliceResult is the bool slice result for redis commands
type Client ¶
type Commands ¶
type Commands interface { Pipeline() Pipeliner Close() error BRPop(ctx context.Context, timeout time.Duration, keys ...string) StringSliceResult BRPopLPush(ctx context.Context, source, destination string, timeout time.Duration) StringResult Del(ctx context.Context, keys ...string) IntResult Eval(ctx context.Context, script string, keys []string, args ...interface{}) Result Exists(ctx context.Context, keys ...string) IntResult Expire(ctx context.Context, key string, expiration time.Duration) BoolResult FlushDB(ctx context.Context) StatusResult Get(ctx context.Context, key string) StringResult HDel(ctx context.Context, key string, fields ...string) IntResult HGet(ctx context.Context, key, field string) StringResult HGetAll(ctx context.Context, key string) StringStringMapResult HIncrBy(ctx context.Context, key, field string, incr int64) IntResult HKeys(ctx context.Context, key string) StringSliceResult HMGet(ctx context.Context, key string, fields ...string) SliceResult HScan(ctx context.Context, key string, cursor uint64, match string, count int64) ScanResult Scan(ctx context.Context, cursor uint64, match string, count int64) ScanResult HSet(ctx context.Context, key string, values ...interface{}) IntResult Incr(ctx context.Context, key string) IntResult Keys(ctx context.Context, pattern string) StringSliceResult LLen(ctx context.Context, key string) IntResult LPush(ctx context.Context, key string, values ...interface{}) IntResult LRange(ctx context.Context, key string, start, stop int64) StringSliceResult LRem(ctx context.Context, key string, count int64, value interface{}) IntResult LTrim(ctx context.Context, key string, start, stop int64) StatusResult MGet(ctx context.Context, keys ...string) SliceResult MSet(ctx context.Context, values ...interface{}) StatusResult Ping(ctx context.Context) StatusResult Publish(ctx context.Context, channel string, message interface{}) IntResult Rename(ctx context.Context, key, newkey string) StatusResult RenameNX(ctx context.Context, key, newkey string) BoolResult RPop(ctx context.Context, key string) StringResult RPopLPush(ctx context.Context, source, destination string) StringResult RPush(ctx context.Context, key string, values ...interface{}) IntResult SAdd(ctx context.Context, key string, members ...interface{}) IntResult Set(ctx context.Context, key string, value interface{}, expiration time.Duration) StatusResult SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) BoolResult MSetNX(ctx context.Context, values ...interface{}) BoolResult SMembers(ctx context.Context, key string) StringSliceResult SRem(ctx context.Context, key string, members ...interface{}) IntResult TTL(ctx context.Context, key string) DurationResult TxPipeline(ctx context.Context) Pipeliner Discard(ctx context.Context, pipe Pipeliner) error }
type DurationResult ¶
type DurationResult interface { Val() time.Duration Result() (time.Duration, error) // contains filtered or unexported methods }
DurationResult is the duration result for redis commands
type FloatResult ¶
type FloatResult interface { Val() float64 Result() (float64, error) // contains filtered or unexported methods }
FloatResult is the float result for redis commands
type IntResult ¶
type IntResult interface { Val() int64 Result() (int64, error) // contains filtered or unexported methods }
IntResult is the int result for redis commands
type IntSliceResult ¶
type IntSliceResult interface { Val() []int64 Result() ([]int64, error) // contains filtered or unexported methods }
IntSliceResult is the int slice result for redis commands
type Option ¶
type Option func(c *Config)
func MasterName ¶
func MaxOpenConns ¶
func SentinelPassword ¶
type Pipeliner ¶
type Pipeliner interface { redis.StatefulCmdable Do(ctx context.Context, args ...interface{}) *redis.Cmd Process(ctx context.Context, cmd redis.Cmder) error Close() error Discard() error Exec(ctx context.Context) ([]redis.Cmder, error) }
Pipeliner is interface for redis pipeline technique
type PubSub ¶
type PubSub interface { Channel(opts ...redis.ChannelOption) <-chan *redis.Message ChannelSize(size int) <-chan *redis.Message ChannelWithSubscriptions(ctx context.Context, size int) <-chan interface{} Close() error Ping(ctx context.Context, payload ...string) error PSubscribe(ctx context.Context, patterns ...string) error PUnsubscribe(ctx context.Context, patterns ...string) error Receive(ctx context.Context) (interface{}, error) ReceiveMessage(ctx context.Context) (*redis.Message, error) ReceiveTimeout(ctx context.Context, timeout time.Duration) (interface{}, error) String() string Subscribe(ctx context.Context, channels ...string) error Unsubscribe(ctx context.Context, channels ...string) error }
type Result ¶
type Result interface { Val() interface{} Result() (interface{}, error) // contains filtered or unexported methods }
Result is the common result for redis commands
type ScanResult ¶
type ScanResult interface { Val() (keys []string, cursor uint64) Result() (keys []string, cursor uint64, err error) // contains filtered or unexported methods }
ScanResult is the duration result for redis commands
type SliceResult ¶
type SliceResult interface { Val() []interface{} Result() ([]interface{}, error) // contains filtered or unexported methods }
SliceResult is the slice result for redis commands
type StatusResult ¶
type StatusResult interface { Val() string Result() (string, error) // contains filtered or unexported methods }
StatusResult is the status result for redis commands
type StringIntMapResult ¶
type StringIntMapResult interface { Val() map[string]int64 Result() (map[string]int64, error) // contains filtered or unexported methods }
StringIntMapResult is the string int map result for redis commands
type StringResult ¶
type StringResult interface { Val() string Result() (string, error) Scan(val interface{}) error // contains filtered or unexported methods }
StringResult is the string result for redis commands
type StringSliceResult ¶
type StringSliceResult interface { Val() []string Result() ([]string, error) // contains filtered or unexported methods }
StringSliceResult is the string slice result for redis commands
type StringStringMapResult ¶
type StringStringMapResult interface { Val() map[string]string Result() (map[string]string, error) // contains filtered or unexported methods }
StringStringMapResult is the string string map result for redis commands
type StringStructMapResult ¶
type StringStructMapResult interface { Val() map[string]struct{} Result() (map[string]struct{}, error) // contains filtered or unexported methods }
StringStructMapResult is the string struct map result for redis commands