Documentation ¶
Index ¶
- Variables
- func StateToString(state zk.State) string
- type Option
- type Options
- type ZooKeeperClient
- func (z *ZooKeeperClient) Destroy()
- 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) GetConnState() zk.State
- func (z *ZooKeeperClient) GetContent(path string) ([]byte, error)
- func (z *ZooKeeperClient) HandleZkEvent(s <-chan zk.Event)
- func (z *ZooKeeperClient) RegisterHandler(event <-chan zk.Event)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func StateToString ¶
StateToString will transfer zk state to string
Types ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options defines the client option.
type ZooKeeperClient ¶
type ZooKeeperClient struct { ZkAddrs []string sync.RWMutex // for conn Timeout time.Duration Wait sync.WaitGroup // contains filtered or unexported fields }
ZooKeeperClient represents zookeeper client Configuration
func NewZooKeeperClient ¶
func (*ZooKeeperClient) Destroy ¶
func (z *ZooKeeperClient) Destroy()
func (*ZooKeeperClient) ExistW ¶
func (z *ZooKeeperClient) ExistW(zkPath string) (<-chan zk.Event, error)
ExistW is a wrapper to the zk connection conn.ExistsW
func (*ZooKeeperClient) GetChildren ¶
func (z *ZooKeeperClient) GetChildren(path string) ([]string, error)
GetChildren gets children by @path
func (*ZooKeeperClient) GetChildrenW ¶
GetChildrenW gets children watch by @path
func (*ZooKeeperClient) GetConnState ¶
func (z *ZooKeeperClient) GetConnState() zk.State
func (*ZooKeeperClient) GetContent ¶
func (z *ZooKeeperClient) GetContent(path string) ([]byte, error)
GetContent gets content by @path
func (*ZooKeeperClient) HandleZkEvent ¶
func (z *ZooKeeperClient) HandleZkEvent(s <-chan zk.Event)
HandleZkEvent handles zookeeper events
func (*ZooKeeperClient) RegisterHandler ¶
func (z *ZooKeeperClient) RegisterHandler(event <-chan zk.Event)
Click to show internal directories.
Click to hide internal directories.