redisd

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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 {
	*redis.Client
	// contains filtered or unexported fields
}

func InitRedis

func InitRedis(cnf Config) *Decorator

func (*Decorator) BfMAdd

func (r *Decorator) BfMAdd(key string, values ...string) ([]interface{}, error)

func (*Decorator) BfMExists

func (r *Decorator) BfMExists(key string, values ...string) ([]interface{}, error)

func (*Decorator) Del

func (r *Decorator) Del(key string) error

func (*Decorator) DelKeys

func (r *Decorator) DelKeys(key string)

func (*Decorator) EitherLock

func (r *Decorator) EitherLock(key string, lockBack bool) (string, int64)

单向锁

func (*Decorator) Get

func (r *Decorator) Get(key string) (string, error)

func (*Decorator) GetObj

func (r *Decorator) GetObj(key string, obj interface{}) error

func (*Decorator) GetSet

func (r *Decorator) GetSet(key string, expire time.Duration, getFormDb func() (string, error)) (string, error)

func (*Decorator) GetSetObj

func (r *Decorator) GetSetObj(key string, obj interface{}, expire time.Duration, getFormDb func() (interface{}, error)) error

func (*Decorator) GetSetObjRefKey

func (r *Decorator) GetSetObjRefKey(key string, obj interface{}, expire time.Duration, getFormDb func() (interface{}, error)) error

func (*Decorator) HSetExEval

func (r *Decorator) HSetExEval(key, field, value string, seconds int32) error

func (*Decorator) IncrEx

func (r *Decorator) IncrEx(key string, expire, count int32) (int64, error)

func (*Decorator) IncrLimitEx

func (r *Decorator) IncrLimitEx(key string, expire, count, limit int32) (int64, error)

增加count大于Limit

func (*Decorator) IncrThanEx

func (r *Decorator) IncrThanEx(key string, expire, count, than int32) (int64, error)

增加count不能超过than

func (*Decorator) Limit

func (r *Decorator) Limit(key string, time, count int32) (bool, error)

func (*Decorator) Lock

func (r *Decorator) Lock(key string, outTime int32) int64

func (*Decorator) SAddEx

func (r *Decorator) SAddEx(key, value string, seconds int32) (int64, error)

func (*Decorator) Set

func (r *Decorator) Set(key string, value string, expire time.Duration) error

func (*Decorator) SetObj

func (r *Decorator) SetObj(key string, obj interface{}, expire time.Duration) error

func (*Decorator) SetObjRefKey

func (r *Decorator) SetObjRefKey(key string, obj interface{}, expire time.Duration) error

type XAddArgs

type XAddArgs struct {
	redis.XAddArgs
	Partition int32 //分区数
}

Jump to

Keyboard shortcuts

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