redis_lock

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

README

redis-lock

redis分布式锁包

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DestroyLock

func DestroyLock(lock *Lock) error

Types

type Lock

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

func NewLock

func NewLock(address string, password string, db int) (*Lock, error)

func (*Lock) Lock

func (lock *Lock) Lock(ownerID string, key string, expireSec int) error

func (*Lock) TryLock

func (lock *Lock) TryLock(ownerID string, key string, expireSec int) (bool, error)

func (*Lock) Unlock

func (lock *Lock) Unlock(ownerID string, key string) error

Jump to

Keyboard shortcuts

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