v3

package
v0.0.0-...-8e4fce1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdLock

type EtcdLock struct {
	Client *clientv3.Client
	Key    string
	Index  uint64
}

func (*EtcdLock) Release

func (lock *EtcdLock) Release() error

type EtcdLocker

type EtcdLocker struct {
	Client *clientv3.Client
}

分布式锁 Etcd结构体

func (*EtcdLocker) Acquire

func (lock *EtcdLocker) Acquire(key string, ttl int64) (Lock, error)

func (*EtcdLocker) WaitAcquire

func (lock *EtcdLocker) WaitAcquire(key string, ttl uint64) (Lock, error)

type Lock

type Lock interface {
	Release() error
}

分布式锁 锁释放接口

type Locker

type Locker interface {
	Acquire(key string, ttl int64) (Lock, error)
	WaitAcquire(key string, ttl uint64) (Lock, error)
}

分布式锁 获取锁接口方法

Jump to

Keyboard shortcuts

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