Documentation ¶
Index ¶
- Constants
- type Client
- type Config
- type Decorator
- func (r *Decorator) BfMAdd(ctx context.Context, key string, values ...string) ([]interface{}, error)
- func (r *Decorator) BfMExists(ctx context.Context, key string, values ...string) ([]interface{}, error)
- func (r *Decorator) Del(ctx context.Context, key string) error
- func (r *Decorator) DelKeys(ctx context.Context, key string)
- func (r *Decorator) EitherLock(ctx context.Context, key string, lockBack bool) (string, int64)
- func (r *Decorator) Get(ctx context.Context, key string) (string, error)
- func (r *Decorator) GetObj(ctx context.Context, key string, obj interface{}) error
- func (r *Decorator) GetSet(ctx context.Context, key string, expire time.Duration, ...) (string, error)
- func (r *Decorator) GetSetObj(ctx context.Context, key string, obj interface{}, expire time.Duration, ...) error
- func (r *Decorator) GetSetObjRefKey(ctx context.Context, key string, obj interface{}, expire time.Duration, ...) error
- func (r *Decorator) HSetExEval(ctx context.Context, key, field, value string, seconds int32) error
- func (r *Decorator) IncrEx(ctx context.Context, key string, expire, count int32) (int64, error)
- func (r *Decorator) IncrLimitEx(ctx context.Context, key string, expire, count, limit int32) (int64, error)
- func (r *Decorator) IncrThanEx(ctx context.Context, key string, expire, count, than int32) (int64, error)
- func (r *Decorator) Limit(ctx context.Context, key string, duration time.Duration, count int32) (bool, error)
- func (r *Decorator) Lock(ctx context.Context, key string, outTime int32) int64
- func (r *Decorator) SAddEx(ctx context.Context, key, value string, seconds int32) (int64, error)
- func (r *Decorator) Set(ctx context.Context, key string, value string, expire time.Duration) error
- func (r *Decorator) SetObj(ctx context.Context, key string, obj interface{}, expire time.Duration) error
- func (r *Decorator) SetObjRefKey(ctx context.Context, key string, obj interface{}, expire time.Duration) error
- type XAddArgs
Constants ¶
View Source
const (
Nil = redis.Nil
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Addr string `yaml:"addr"` Passwd string `yaml:"passwd"` LocalCache bool `yaml:"localCache"` Chanel string `yaml:"chanel"` Size int `yaml:"size"` LocalExpire int `yaml:"localExpire"` RedisLocalExpire int `yaml:"redisLocalExpire"` FailSleep int64 `yaml:"failSleep"` FailWaitCount int64 `yaml:"failWaitCount"` }
type Decorator ¶
type Decorator struct { Client // contains filtered or unexported fields }
func (*Decorator) EitherLock ¶
单向锁
func (*Decorator) GetSetObjRefKey ¶
func (*Decorator) HSetExEval ¶
func (*Decorator) IncrLimitEx ¶
func (r *Decorator) IncrLimitEx(ctx context.Context, key string, expire, count, limit int32) (int64, error)
增加count大于Limit
func (*Decorator) IncrThanEx ¶
func (r *Decorator) IncrThanEx(ctx context.Context, key string, expire, count, than int32) (int64, error)
增加count不能超过than
Click to show internal directories.
Click to hide internal directories.