etcdlock

package
v0.0.0-...-6da71e2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitKeysDelete

func WaitKeysDelete(ctx context.Context, c *v3.Client, prefix string, response *v3.GetResponse) error

WaitKeysDelete waits on a keys until it observes the given delete event or returns error if the channel closes.

Types

type EphemeralKV

type EphemeralKV struct{ RemoteKV }

EphemeralKV is a new key associated with a session lease

type RWMutex

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

RWMutex struct for RWLock mutext

func NewRWMutex

func NewRWMutex(s *concurrency.Session, prefix string) *RWMutex

NewRWMutex for RWLock management. Session will define a refreshing update of a lock on server. If session is Orphaned or closed, the remote lock will be lost.

func (*RWMutex) RLock

func (rwm *RWMutex) RLock(ctx context.Context) error

RLock Read Lock. Will obey context for the deadline or canceling of lock acquirement

func (*RWMutex) RWLock

func (rwm *RWMutex) RWLock(ctx context.Context) error

RWLock Read Write Lock. Will obey context for the deadline or canceling of lock acquirement

func (*RWMutex) Unlock

func (rwm *RWMutex) Unlock() error

Unlock a previously acquired lock

type RemoteKV

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

RemoteKV is a key/revision pair created by the client and stored on etcd

func (*RemoteKV) Delete

func (rk *RemoteKV) Delete() error

func (*RemoteKV) Key

func (rk *RemoteKV) Key() string

func (*RemoteKV) Put

func (rk *RemoteKV) Put(val string) error

func (*RemoteKV) Revision

func (rk *RemoteKV) Revision() int64

func (*RemoteKV) Value

func (rk *RemoteKV) Value() string

Jump to

Keyboard shortcuts

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