watcher

package
v0.0.0-...-cb6d2b4 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	//etcd://ip:port,ip:port
	Target  string
	Timeout time.Duration
}

type WatcherI

type WatcherI interface {
	GetLocalIp() string
	Create(path string, data string) error
	Delete(path string) error

	Read(path string) (string, uint64, error)
	//return keys, index, error
	List(path string) ([]string, uint64, error)

	Update(path string, data []byte) error

	//cb should return afterIndex
	Watch(path string, cb func() (uint64, error)) error

	CreateEphemeral(path string, data []byte) error
	CreateEphemeralInOrder(path string, data []byte) error

	Close() error
}

func New

func New(ctx context.Context, config *Config) (WatcherI, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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