Versions in this module Expand all Collapse all v1 v1.14.1 Dec 28, 2024 v1.13.1 Dec 28, 2024 Changes in this version + const SLASH + var ErrNilZkClientConn = perrors.New("Zookeeper Client{conn} is nil") + var ErrStatIsNil = perrors.New("Stat of the node is nil") + func StateToString(state zk.State) string + func WithZkEventHandler(handler ZkEventHandler) zkClientOption + func WithZkTimeOut(t time.Duration) zkClientOption + type DefaultHandler struct + func (d *DefaultHandler) HandleZkEvent(z *ZookeeperClient) + type Option func(*options) + func WithTestCluster(ts *zk.TestCluster) Option + func WithZkName(name string) Option + type ZkEventHandler interface + HandleZkEvent func(z *ZookeeperClient) + type ZookeeperClient struct + Conn *zk.Conn + Session <-chan zk.Event + Timeout time.Duration + Wait sync.WaitGroup + ZkAddrs []string + func NewMockZookeeperClient(name string, timeout time.Duration, opts ...Option) (*zk.TestCluster, *ZookeeperClient, <-chan zk.Event, error) + func NewZookeeperClient(name string, zkAddrs []string, username string, password string, share bool, ...) (*ZookeeperClient, error) + func (z *ZookeeperClient) Close() + func (z *ZookeeperClient) Create(basePath string) error + func (z *ZookeeperClient) CreateTempWithValue(basePath string, value []byte) error + func (z *ZookeeperClient) CreateWithValue(basePath string, value []byte) error + func (z *ZookeeperClient) Delete(basePath string) error + func (z *ZookeeperClient) ExistW(zkPath string) (<-chan zk.Event, error) + func (z *ZookeeperClient) GetChildren(path string) ([]string, error) + func (z *ZookeeperClient) GetChildrenW(path string) ([]string, <-chan zk.Event, error) + func (z *ZookeeperClient) GetContent(zkPath string) ([]byte, *zk.Stat, error) + func (z *ZookeeperClient) GetEventHandler() ZkEventHandler + func (z *ZookeeperClient) Reconnect() <-chan struct{} + func (z *ZookeeperClient) RegisterEvent(zkPath string, event chan zk.Event) + func (z *ZookeeperClient) RegisterTemp(basePath string, node string) (string, error) + func (z *ZookeeperClient) RegisterTempSeq(basePath string, data []byte) (string, error) + func (z *ZookeeperClient) SetContent(zkPath string, content []byte, version int32) (*zk.Stat, error) + func (z *ZookeeperClient) UnregisterEvent(zkPath string, event chan zk.Event) + func (z *ZookeeperClient) ZkConnValid() bool