zk

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 28, 2014 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// error
	ErrNoChild      = errors.New("zk: children is nil")
	ErrNodeNotExist = errors.New("zk: node not exist")
)

Functions

func Connect

func Connect(addr []string, timeout time.Duration) (*zk.Conn, error)

Connect connect to zookeeper, and start a goroutine log the event.

func Create

func Create(conn *zk.Conn, fpath string) error

Create create zookeeper path, if path exists ignore error

func GetNodes

func GetNodes(conn *zk.Conn, path string) ([]string, error)

GetNodes get all child from zk path.

func GetNodesW

func GetNodesW(conn *zk.Conn, path string) ([]string, <-chan zk.Event, error)

GetNodesW get all child from zk path with a watch.

func RegisterTemp

func RegisterTemp(conn *zk.Conn, fpath, data string) error

RegisterTmp create a ephemeral node, and watch it, if node droped then send a SIGQUIT to self.

Types

This section is empty.

Jump to

Keyboard shortcuts

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