redis

package
v0.5.21 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MIT Imports: 11 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(expire int) (bool, error)

Acquire acquires the lock. 单位:秒 加锁

func (*Lock) Release

func (rl *Lock) Release() (bool, error)

Release releases the lock. 释放锁

func (*Lock) Renewal

func (rl *Lock) Renewal(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(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