redis

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorNotInitRedis = errors.New("redis not init")
)

Functions

func Create added in v0.9.0

func Create(id, name string, v *Config, workers map[eosc.RequireId]eosc.IWorker) (eosc.IWorker, error)

func NewFactory added in v0.9.0

func NewFactory() eosc.IExtenderDriverFactory

NewFactory 创建service_http驱动工厂

func Register

func Register(register eosc.IExtenderDriverRegister)

Types

type Cmdable added in v0.9.0

type Cmdable struct {
	// contains filtered or unexported fields
}

func (*Cmdable) BuildVector added in v0.9.0

func (r *Cmdable) BuildVector(name string, uni, step time.Duration) (resources.Vector, error)

func (*Cmdable) DecrBy added in v0.9.0

func (r *Cmdable) DecrBy(ctx context.Context, key string, decrement int64, expiration time.Duration) resources.IntResult

func (*Cmdable) Del added in v0.9.0

func (r *Cmdable) Del(ctx context.Context, keys ...string) resources.IntResult

func (*Cmdable) Get added in v0.9.0

func (*Cmdable) GetDel added in v0.9.0

func (r *Cmdable) GetDel(ctx context.Context, key string) resources.StringResult

func (*Cmdable) IncrBy added in v0.9.0

func (r *Cmdable) IncrBy(ctx context.Context, key string, decrement int64, expiration time.Duration) resources.IntResult

func (*Cmdable) Set added in v0.9.0

func (r *Cmdable) Set(ctx context.Context, key string, value []byte, expiration time.Duration) resources.StatusResult

func (*Cmdable) SetNX added in v0.9.0

func (r *Cmdable) SetNX(ctx context.Context, key string, value []byte, expiration time.Duration) resources.BoolResult

func (*Cmdable) Tx added in v0.9.0

func (r *Cmdable) Tx() resources.TX

type Config

type Config struct {
	Addrs    []string `json:"addrs" label:"redis 节点列表"`
	Username string   `json:"username"`
	Password string   `json:"password"`
}

type Empty added in v0.9.0

type Empty struct {
}

func (*Empty) BuildVector added in v0.9.0

func (e *Empty) BuildVector(name string, uni, step time.Duration) (resources.Vector, error)

func (*Empty) DecrBy added in v0.9.0

func (e *Empty) DecrBy(ctx context.Context, key string, decrement int64, expiration time.Duration) resources.IntResult

func (*Empty) Del added in v0.9.0

func (e *Empty) Del(ctx context.Context, keys ...string) resources.IntResult

func (*Empty) Exec added in v0.9.0

func (e *Empty) Exec(ctx context.Context) error

func (*Empty) Get added in v0.9.0

func (e *Empty) Get(ctx context.Context, key string) resources.StringResult

func (*Empty) GetDel added in v0.9.0

func (e *Empty) GetDel(ctx context.Context, key string) resources.StringResult

func (*Empty) IncrBy added in v0.9.0

func (e *Empty) IncrBy(ctx context.Context, key string, decrement int64, expiration time.Duration) resources.IntResult

func (*Empty) Set added in v0.9.0

func (e *Empty) Set(ctx context.Context, key string, value []byte, expiration time.Duration) resources.StatusResult

func (*Empty) SetNX added in v0.9.0

func (e *Empty) SetNX(ctx context.Context, key string, value []byte, expiration time.Duration) resources.BoolResult

func (*Empty) Tx added in v0.9.0

func (e *Empty) Tx() resources.TX

type TxPipeline added in v0.9.0

type TxPipeline struct {
	Cmdable
	// contains filtered or unexported fields
}

func (*TxPipeline) Exec added in v0.9.0

func (tx *TxPipeline) Exec(ctx context.Context) error

func (*TxPipeline) Tx added in v0.9.0

func (tx *TxPipeline) Tx() resources.TX

type Vector added in v0.9.0

type Vector struct {
	// contains filtered or unexported fields
}

func (*Vector) Add added in v0.9.0

func (v *Vector) Add(key string, delta int64)

func (*Vector) CompareAndAdd added in v0.9.0

func (v *Vector) CompareAndAdd(key string, threshold, delta int64) bool

func (*Vector) Get added in v0.9.0

func (v *Vector) Get(key string) int64

type Worker added in v0.9.0

type Worker struct {
	drivers.WorkerBase
	resources.ICache
	resources.IVectors
	// contains filtered or unexported fields
}

func (*Worker) CheckSkill added in v0.9.0

func (w *Worker) CheckSkill(skill string) bool

func (*Worker) Reset added in v0.9.0

func (w *Worker) Reset(conf interface{}, workers map[eosc.RequireId]eosc.IWorker) error

func (*Worker) Start added in v0.9.0

func (w *Worker) Start() error

func (*Worker) Stop added in v0.9.0

func (w *Worker) Stop() error

Jump to

Keyboard shortcuts

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