redis

package module
v0.0.0-...-0c44c77 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: LGPL-2.1 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOption = option{
	// contains filtered or unexported fields
}

Functions

func NewOption

func NewOption(opts ...optionFn) *option

func WithAddr

func WithAddr(addr string) optionFn

func WithDB

func WithDB(db int) optionFn

func WithPassword

func WithPassword(password string) optionFn

Types

type RedisDriver

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

func NewRedisDriver

func NewRedisDriver(opt *option) (*RedisDriver, error)

func (*RedisDriver) Lock

func (d *RedisDriver) Lock(key string) (bool, error)

func (*RedisDriver) Ping

func (d *RedisDriver) Ping() error

检测连接状态

func (*RedisDriver) PipelineIncr

func (d *RedisDriver) PipelineIncr()

func (*RedisDriver) StringDel

func (d *RedisDriver) StringDel(key string) bool

func (*RedisDriver) StringGet

func (d *RedisDriver) StringGet(key string) string

string

func (*RedisDriver) StringSet

func (d *RedisDriver) StringSet(key, value string) bool

func (*RedisDriver) Transaction

func (d *RedisDriver) Transaction(key string) error

func (*RedisDriver) TryPub

func (d *RedisDriver) TryPub(channel, message string)

func (*RedisDriver) TrySub

func (d *RedisDriver) TrySub(channel string) string

func (*RedisDriver) UnLock

func (d *RedisDriver) UnLock(key string) (int64, error)

为了避免其他工作任务解到锁,可以使用一个唯一value进行标识

Jump to

Keyboard shortcuts

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