lock

package
v0.0.0-...-c2c101f Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Locker

type Locker struct {
	Client     *clientv3.Client
	MutexMap   map[string]*concurrency.Mutex
	SessionMap map[string]*concurrency.Session
}

func NewLocker

func NewLocker() (*Locker, error)

func (*Locker) Lock

func (locker *Locker) Lock(ctx context.Context, key string) (int64, string, error)

func (*Locker) Stop

func (locker *Locker) Stop() (err error)

func (*Locker) Unlock

func (locker *Locker) Unlock(ctx context.Context, key string) (err error)

Jump to

Keyboard shortcuts

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