redis

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnLockGet = errors.New("lock has already unlocked or expired")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	DBName        string
	DBIndex       int
	Addr          string
	Password      string
	MaxActive     int
	MaxIdle       int
	IdleTimeout   time.Duration
	DialTimeout   time.Duration
	ReadTimeout   time.Duration
	WriteTimeout  time.Duration
	SlowOpTimeout time.Duration
}

type Redis

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

func New

func New(conf *Config) *Redis

func (*Redis) Close

func (r *Redis) Close() error

func (*Redis) Do

func (r *Redis) Do(ctx context.Context, commandName string, args ...interface{}) (interface{}, error)

func (*Redis) ForceUnLock

func (r *Redis) ForceUnLock(ctx context.Context, key string) error

func (*Redis) Lock

func (r *Redis) Lock(ctx context.Context, key string) (err error, gotLock bool, lockValue string)

func (*Redis) Ping added in v0.2.0

func (r *Redis) Ping(ctx context.Context) error

func (*Redis) UnLock

func (r *Redis) UnLock(ctx context.Context, key, lockValue string) error

Jump to

Keyboard shortcuts

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