redis

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 12 Imported by: 4

Documentation

Index

Constants

View Source
const (
	Proto = "redis"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Lock

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

A Lock is a redis lock.

func (*Lock) Acquire

func (rl *Lock) Acquire(ctx context.Context, expire int) (bool, error)

Acquire acquires the lock. 单位:秒 加锁

func (*Lock) Release

func (rl *Lock) Release(ctx context.Context) (bool, error)

Release releases the lock. 释放锁

func (*Lock) Renewal

func (rl *Lock) Renewal(ctx context.Context, expire int) error

单位:秒 续约

type Redis

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

Redis cache implement

func (*Redis) Build

func (r *Redis) Build(key string, opts ...dlocker.Option) dlocker.DLocker

Build 构建锁

func (*Redis) Eval

func (r *Redis) Eval(ctx context.Context, cmd string, keys []string, vals []string) (obj interface{}, err error)

Eval 执行脚本

func (*Redis) GetImpl

func (r *Redis) GetImpl() interface{}

GetImpl 暴露原生client

Jump to

Keyboard shortcuts

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