consul

package
v0.0.0-...-da19eeb Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2019 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefaultConsulLockRetryInterval = 5 * time.Second
)

Variables

This section is empty.

Functions

func NewClient

func NewClient() (*api.Client, error)

Types

type ConsulLock

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

func NewConsulLock

func NewConsulLock(client *api.Client, opts *ConsulLockOptions) (*ConsulLock, error)

func (*ConsulLock) AsyncLock

func (p *ConsulLock) AsyncLock()

func (*ConsulLock) AsyncUnlock

func (p *ConsulLock) AsyncUnlock() bool

func (*ConsulLock) CancelPendingLock

func (p *ConsulLock) CancelPendingLock()

type ConsulLockOptions

type ConsulLockOptions struct {
	Key           string
	FakeLock      bool
	OnStateChange func(bool)
	RetryInterval time.Duration
}

type KVPair

type KVPair = api.KVPair

type KeyChangeHandler

type KeyChangeHandler func(kv *KVPair)

type KeyWatch

type KeyWatch struct {
	C <-chan *KVPair
	// contains filtered or unexported fields
}

func NewKeyWatch

func NewKeyWatch(api *api.Client) *KeyWatch

func (*KeyWatch) Add

func (o *KeyWatch) Add(key string)

func (*KeyWatch) AddHandler

func (o *KeyWatch) AddHandler(key string, handler KeyChangeHandler)

func (*KeyWatch) Shutdown

func (o *KeyWatch) Shutdown()

Jump to

Keyboard shortcuts

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