etcdlock

package
v0.0.0-...-ebdab26 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mutex

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

func NewMutex

func NewMutex(client *clientv3.Client, key string, ttlSec int) (*Mutex, error)

NewMutex 新建一把锁

func (*Mutex) Key

func (mutex *Mutex) Key() string

func (*Mutex) Lock

func (mutex *Mutex) Lock(timeout time.Duration) error

func (*Mutex) TryLock

func (mutex *Mutex) TryLock(ctx context.Context) error

func (*Mutex) Unlock

func (mutex *Mutex) Unlock() error

Jump to

Keyboard shortcuts

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