etcd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 6 Imported by: ? modules, 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

This section is empty.

Functions

This section is empty.

Types

type Etcd

type Etcd struct {
	*clientv3.Client
}

func Connect

func Connect(endpoints []string, prefix string) (*Etcd, error)

func (*Etcd) Dlock

func (etcd *Etcd) Dlock(ctx context.Context, key string, cb callback) error

func (*Etcd) DlockWithTimeout

func (etcd *Etcd) DlockWithTimeout(key string, timeout time.Duration, cb callback) error

func (*Etcd) NewMutex

func (etcd *Etcd) NewMutex(key string) (*Mutex, error)

type Mutex

type Mutex struct {
	*concurrency.Mutex
}

func (*Mutex) Lock

func (m *Mutex) Lock(ctx context.Context) error

Lock locks the mutex with a cancelable context. If the context is canceled while trying to acquire the lock, the mutex tries to clean its stale lock entry.

func (*Mutex) Unlock

func (m *Mutex) Unlock(ctx context.Context) error

Jump to

Keyboard shortcuts

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