Documentation ¶
Index ¶
- Variables
- func WithZkTimeOut(t time.Duration) zkClientOption
- type Client
- func (c *Client) Close()
- func (c *Client) ConnValid() bool
- func (c *Client) Create(basePath string) error
- func (c *Client) CreateTempWithValue(basePath string, value []byte) error
- func (c *Client) CreateWithValue(basePath string, value []byte) error
- func (c *Client) Delete(basePath string) error
- func (c *Client) ExistW(zkPath string) (<-chan zk.Event, error)
- func (c *Client) GetChildren(path string) ([]string, error)
- func (c *Client) GetChildrenW(path string) ([]string, <-chan zk.Event, error)
- func (c *Client) GetContent(zkPath string) ([]byte, *zk.Stat, error)
- func (c *Client) GetEventHandler() EventHandler
- func (c *Client) Reconnect() <-chan struct{}
- func (c *Client) RegisterEvent(zkPath string, event chan zk.Event)
- func (c *Client) RegisterTemp(basePath string, node string) (string, error)
- func (c *Client) RegisterTempSeq(basePath string, data []byte) (string, error)
- func (c *Client) SetContent(zkPath string, content []byte, version int32) (*zk.Stat, error)
- func (c *Client) UnregisterEvent(zkPath string, event chan zk.Event)
- type DefaultHandler
- type EventHandler
- type Option
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNilZkClientConn no conn error ErrNilZkClientConn = errors.New("Zookeeper Client{conn} is nil") ErrStatIsNil = errors.New("Stat of the node is nil") )
Functions ¶
func WithZkTimeOut ¶
WithZkTimeOut sets zk Client timeout
Types ¶
type Client ¶
Client represents zookeeper Client Configuration
func (*Client) Create ¶
Create will create the node recursively, which means that if the parent node is absent, it will create parent node first. And the value for the basePath is ""
func (*Client) CreateTempWithValue ¶
CreateTempWithValue will create the node recursively, which means that if the parent node is absent, it will create parent node first,and set value in last child path If the path exist, it will update data
func (*Client) CreateWithValue ¶
CreateWithValue will create the node recursively, which means that if the parent node is absent, it will create parent node first. basePath should start with "/"
func (*Client) GetChildren ¶
GetChildren gets children by @path
func (*Client) GetChildrenW ¶
GetChildrenW gets children watch by @path
func (*Client) GetContent ¶
GetContent gets content by @zkPath
func (*Client) GetEventHandler ¶
func (c *Client) GetEventHandler() EventHandler
GetEventHandler gets zookeeper event handler
func (*Client) Reconnect ¶
func (c *Client) Reconnect() <-chan struct{}
Reconnect gets zookeeper reconnect event
func (*Client) RegisterEvent ¶
RegisterEvent registers zookeeper events
func (*Client) RegisterTemp ¶
RegisterTemp registers temporary node by @basePath and @node
func (*Client) RegisterTempSeq ¶
RegisterTempSeq register temporary sequence node by @basePath and @data
func (*Client) SetContent ¶
SetContent set content of zkPath
type DefaultHandler ¶
type DefaultHandler struct{}
DefaultHandler is default handler for zk event
func (*DefaultHandler) HandleEvent ¶
func (d *DefaultHandler) HandleEvent(z *Client)
HandleEvent handles zookeeper events nolint