Documentation ¶
Overview ¶
Package gxzookeeper provides a zookeeper driver based on samuel/go-zookeeper/zk
Index ¶
- Variables
- func GetMaxSequenceNumber(children []string, prefix string) (seq int, index int, retError error)
- func GetMinSequenceNumber(children []string, prefix string) (seq int, index int, retError error)
- type Client
- func (c *Client) Campaign(basePath string, timeout time.Duration) error
- func (c *Client) CreateZkPath(basePath string) error
- func (c *Client) DeleteZkPath(path string) error
- func (c *Client) Exist(path string) (bool, error)
- func (c *Client) ExistW(path string) (<-chan zk.Event, error)
- func (c *Client) Get(path string) ([]byte, error)
- func (c *Client) GetChildren(path string) ([]string, error)
- func (c *Client) GetChildrenW(path string) ([]string, <-chan zk.Event, error)
- func (c *Client) GetMinZkPath(baseZkPath, prefix string) ([]string, string, error)
- func (c *Client) Lock(basePath string) error
- func (c *Client) RegisterSeq(path string, data []byte) (string, error)
- func (c *Client) RegisterTemp(path string, data []byte) (string, error)
- func (c *Client) RegisterTempSeq(path string, data []byte) (string, error)
- func (c *Client) Resign(basePath string) error
- func (c *Client) StateToString(state zk.State) string
- func (c *Client) Unlock(basePath string) error
- func (c *Client) ZkConn() *zk.Conn
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrDeadlock is returned by Lock when trying to lock twice without unlocking first ErrDeadlock = jerrors.New("zk: trying to acquire a lock twice") // ErrNotLocked is returned by Unlock when trying to release a lock that has not first be acquired. ErrNotLocked = jerrors.New("zk: not locked") )
Functions ¶
func GetMaxSequenceNumber ¶ added in v0.3.2
get the maximum sequence number.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Campaign ¶ added in v0.3.2
if @timeout <= 0, Campaign will loop to get the leadership until success.
func (*Client) DeleteZkPath ¶
像创建一样,删除节点的时候也只能从叶子节点逐级回退删除 当节点还有子节点的时候,删除是不会成功的
func (*Client) GetChildrenW ¶
func (*Client) GetMinZkPath ¶ added in v0.3.2
func (*Client) RegisterSeq ¶ added in v0.3.2
func (*Client) RegisterTemp ¶
func (*Client) RegisterTempSeq ¶
Click to show internal directories.
Click to hide internal directories.