appmsgsrv: github.com/EPICPaaS/appmsgsrv/zk Index | Files

package zk

import "github.com/EPICPaaS/appmsgsrv/zk"

Index

Package Files

zk.go

Variables

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

func Connect Uses

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

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

func Create Uses

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

Create create zookeeper path, if path exists ignore error

func GetNodes Uses

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

GetNodes get all child from zk path.

func GetNodesW Uses

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

GetNodesW get all child from zk path with a watch.

func RegisterTemp Uses

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.

Package zk imports 8 packages (graph) and is imported by 4 packages. Updated 2017-06-29. Refresh now. Tools for package owners.