Documentation ¶
Index ¶
- Constants
- type Conn
- func (c *Conn) Close()
- func (c *Conn) Conn() *zk.Conn
- func (c *Conn) Create(path string, data []byte) error
- func (c *Conn) CreateEphemeral(path string, data []byte) error
- func (c *Conn) CreateSequence(path string, data []byte) (string, error)
- func (c *Conn) Delete(path string) error
- func (c *Conn) Exists(path string) (bool, error)
- func (c *Conn) Get(path string) ([]byte, error)
- func (c *Conn) GetChildren(path string) (map[string][]byte, error)
- func (c *Conn) MakeDirP(dir string) error
- func (c *Conn) SetConn(conn *zk.Conn)
- func (c *Conn) Watch(path string, cb FuncWatchCallback, stopCh chan struct{}) error
- func (c *Conn) WatchChildren(path string, cb FuncWatchChildrenCallback, stopCh chan struct{}) error
- func (c *Conn) WatchDir(path string, events chan *EventDataChild, exit chan struct{})
- func (c *Conn) WatchNode(path string, events chan *EventDataNode, exit chan struct{})
- func (c *Conn) Write(path string, data []byte) error
- func (c *Conn) WriteEphemeral(path string, data []byte) error
- type EventDataChild
- type EventDataNode
- type FuncWatchCallback
- type FuncWatchChildrenCallback
Constants ¶
View Source
const ( //zk session的超时时间,在此时间内,session可以自动保活 //如果在此时间内,与特定server的连接断开,自动尝试重连其他服务器 //重连成功之后,临时节点和watch依然有效 DefaultConnectTimeout = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) CreateSequence ¶
func (*Conn) Watch ¶
func (c *Conn) Watch(path string, cb FuncWatchCallback, stopCh chan struct{}) error
func (*Conn) WatchChildren ¶
func (c *Conn) WatchChildren(path string, cb FuncWatchChildrenCallback, stopCh chan struct{}) error
func (*Conn) WatchDir ¶
func (c *Conn) WatchDir(path string, events chan *EventDataChild, exit chan struct{})
watch一个dir的子节点,关注节点的增删
func (*Conn) WatchNode ¶
func (c *Conn) WatchNode(path string, events chan *EventDataNode, exit chan struct{})
type EventDataChild ¶
type EventDataNode ¶
type FuncWatchChildrenCallback ¶
回调:监视子节点改变
Click to show internal directories.
Click to hide internal directories.