etcdv3

package
v0.0.0-...-30e45d9 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sync

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

Sync is struct for etcd based sync

func NewSync

func NewSync(etcdServers []string, timeout time.Duration) (*Sync, error)

NewSync initialize new etcd sync

func (*Sync) Close

func (s *Sync) Close()

func (*Sync) Delete

func (s *Sync) Delete(key string) error

Delete sync update sync

func (*Sync) Fetch

func (s *Sync) Fetch(key string) (*sync.Node, error)

Fetch data from sync

func (*Sync) HasLock

func (s *Sync) HasLock(path string) bool

HasLock checks current process owns lock or not

func (*Sync) Lock

func (s *Sync) Lock(path string, block bool) error

Lock locks resources on sync This call blocks until you can get lock

func (*Sync) Unlock

func (s *Sync) Unlock(path string) error

Unlock path

func (*Sync) Update

func (s *Sync) Update(key, jsonString string) error

Update sync update sync When jsonString is empty, this method do nothing because etcd v3 doesn't support directories.

func (*Sync) Watch

func (s *Sync) Watch(path string, responseChan chan *sync.Event, stopChan chan bool, revision int64) error

Watch keep watch update under the path

Jump to

Keyboard shortcuts

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