Documentation ¶
Index ¶
- Constants
- func GetFullyQualifiedKey(appId cfg.AppId, key string) string
- func IsRetryableError(err error) bool
- func NewBackoffExecutor(logger log.Logger, settings exec.BackoffSettings, name string) exec.Executor
- func NewExecutor(logger log.Logger, settings exec.BackoffSettings, name string) exec.Executor
- func NilChecker(_ interface{}, err error) exec.ErrorType
- func OOMChecker(_ interface{}, err error) exec.ErrorType
- func RetryableErrorChecker(_ interface{}, err error) exec.ErrorType
- type Client
- func NewClient(config cfg.Config, logger log.Logger, name string) (Client, error)
- func NewClientWithInterfaces(logger log.Logger, baseRedis baseRedis.Cmdable, executor exec.Executor, ...) Client
- func ProvideClient(ctx context.Context, config cfg.Config, logger log.Logger, name string) (Client, error)
- type Dialer
- type ErrCmder
- type Naming
- type Pipeliner
- type Settings
- type SrvNamingFactory
- type Z
- type ZAddArgs
- type ZRangeArgs
Constants ¶
View Source
const ( DialerSrv = "srv" DialerTcp = "tcp" )
View Source
const (
Nil = baseRedis.Nil
)
Variables ¶
This section is empty.
Functions ¶
func IsRetryableError ¶
func NewBackoffExecutor ¶
func NewExecutor ¶
func NilChecker ¶
func OOMChecker ¶
func RetryableErrorChecker ¶
Types ¶
type Client ¶
type Client interface { Del(ctx context.Context, keys ...string) (int64, error) DBSize(ctx context.Context) (int64, error) Exists(ctx context.Context, keys ...string) (int64, error) Expire(ctx context.Context, key string, ttl time.Duration) (bool, error) FlushDB(ctx context.Context) (string, error) Get(ctx context.Context, key string) (string, error) GetDel(ctx context.Context, key string) (interface{}, error) GetSet(ctx context.Context, key string, value interface{}) (interface{}, error) MGet(ctx context.Context, keys ...string) ([]interface{}, error) MSet(ctx context.Context, pairs ...interface{}) error Set(ctx context.Context, key string, value interface{}, ttl time.Duration) error SetNX(ctx context.Context, key string, value interface{}, ttl time.Duration) (bool, error) BLPop(ctx context.Context, timeout time.Duration, keys ...string) ([]string, error) LPop(ctx context.Context, key string) (string, error) LLen(ctx context.Context, key string) (int64, error) LPush(ctx context.Context, key string, values ...interface{}) (int64, error) LRem(ctx context.Context, key string, count int64, value interface{}) (int64, error) RPush(ctx context.Context, key string, values ...interface{}) (int64, error) RPop(ctx context.Context, key string) (string, error) HDel(ctx context.Context, key string, fields ...string) (int64, error) HExists(ctx context.Context, key string, field string) (bool, error) HGet(ctx context.Context, key string, field string) (string, error) HGetAll(ctx context.Context, key string) (map[string]string, error) HKeys(ctx context.Context, key string) ([]string, error) HMGet(ctx context.Context, key string, fields ...string) ([]interface{}, error) HMSet(ctx context.Context, key string, pairs map[string]interface{}) error HSet(ctx context.Context, key string, field string, value interface{}) error HSetNX(ctx context.Context, key string, field string, value interface{}) (bool, error) SAdd(ctx context.Context, key string, values ...interface{}) (int64, error) SCard(ctx context.Context, key string) (int64, error) SDiff(ctx context.Context, keys ...string) ([]string, error) SDiffStore(ctx context.Context, destination string, keys ...string) (int64, error) SInter(ctx context.Context, keys ...string) ([]string, error) SInterStore(ctx context.Context, destination string, keys ...string) (int64, error) SMembers(ctx context.Context, key string) ([]string, error) SIsMember(ctx context.Context, key string, value interface{}) (bool, error) SMove(ctx context.Context, sourceKey string, destKey string, member interface{}) (bool, error) SPop(ctx context.Context, key string) (string, error) SRem(ctx context.Context, key string, values ...interface{}) (int64, error) SRandMember(ctx context.Context, key string) (string, error) SUnion(ctx context.Context, keys ...string) ([]string, error) SUnionStore(ctx context.Context, destination string, keys ...string) (int64, error) Decr(ctx context.Context, key string) (int64, error) DecrBy(ctx context.Context, key string, amount int64) (int64, error) Incr(ctx context.Context, key string) (int64, error) IncrBy(ctx context.Context, key string, amount int64) (int64, error) PFAdd(ctx context.Context, key string, els ...interface{}) (int64, error) PFCount(ctx context.Context, keys ...string) (int64, error) PFMerge(ctx context.Context, dest string, keys ...string) (string, error) ZAdd(ctx context.Context, key string, score float64, member string) (int64, error) ZAddArgs(ctx context.Context, args ZAddArgs) (int64, error) ZAddArgsIncr(ctx context.Context, args ZAddArgs) (float64, error) ZCard(ctx context.Context, key string) (int64, error) ZCount(ctx context.Context, key string, min string, max string) (int64, error) ZIncrBy(ctx context.Context, key string, increment float64, member string) (float64, error) ZScore(ctx context.Context, key string, member string) (float64, error) ZMScore(ctx context.Context, key string, members ...string) ([]float64, error) ZRange(ctx context.Context, key string, start int64, stop int64) ([]string, error) ZRangeArgs(ctx context.Context, args ZRangeArgs) ([]string, error) ZRangeArgsWithScore(ctx context.Context, args ZRangeArgs) ([]Z, error) ZRandMember(ctx context.Context, key string, count int) ([]string, error) ZRank(ctx context.Context, key string, member string) (int64, error) ZRem(ctx context.Context, key string, members ...string) (int64, error) ZRevRank(ctx context.Context, key string, member string) (int64, error) IsAlive(ctx context.Context) bool Pipeline() Pipeliner }
func NewClientWithInterfaces ¶
type Naming ¶
type Naming struct {
Pattern string `cfg:"pattern,nodecode" default:"{name}.{group}.redis.{env}.{family}"`
}
type Settings ¶
Click to show internal directories.
Click to hide internal directories.