Documentation ¶
Index ¶
- Variables
- type Config
- type Info
- type NodeEvent
- type NodeInfo
- type StatInfo
- type WatchChildrenListenData
- type ZKService
- func (this_ *ZKService) Create(path string, data []byte, mode int32) (err error)
- func (this_ *ZKService) CreateIfNotExists(path string, data []byte) (err error)
- func (this_ *ZKService) Delete(path string) (err error)
- func (this_ *ZKService) Exists(path string) (isExist bool, err error)
- func (this_ *ZKService) Get(path string) (info *NodeInfo, err error)
- func (this_ *ZKService) GetChildren(path string) (children []string, err error)
- func (this_ *ZKService) GetConn() *zk.Conn
- func (this_ *ZKService) GetServers() []string
- func (this_ *ZKService) Info() (info *Info, err error)
- func (this_ *ZKService) Set(path string, data []byte) (err error)
- func (this_ *ZKService) Stat(path string) (info *StatInfo, err error)
- func (this_ *ZKService) Stop()
- func (this_ *ZKService) WatchChildren(path string, listen func(data *WatchChildrenListenData) (finish bool)) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var NodeEventAdded = newNodeEvent("node event node added")
View Source
var NodeEventDeleted = newNodeEvent("node event node deleted")
View Source
var NodeEventError = newNodeEvent("node event node listen error")
View Source
var NodeEventNodeNotFound = newNodeEvent("node event node not found")
View Source
var NodeEventStopped = newNodeEvent("node event zk is stopped")
View Source
var ZKLogger zk.Logger = &defaultLogger{}
Functions ¶
This section is empty.
Types ¶
type StatInfo ¶
type StatInfo struct { Czxid int64 `json:"czxid,omitempty"` Mzxid int64 `json:"mzxid,omitempty"` Ctime int64 `json:"ctime,omitempty"` Mtime int64 `json:"mtime,omitempty"` Version int32 `json:"version,omitempty"` Cversion int32 `json:"cversion,omitempty"` Aversion int32 `json:"aversion,omitempty"` EphemeralOwner int64 `json:"ephemeralOwner,omitempty"` DataLength int32 `json:"dataLength,omitempty"` NumChildren int32 `json:"numChildren,omitempty"` Pzxid int64 `json:"pzxid,omitempty"` }
func StatToInfo ¶
type WatchChildrenListenData ¶
type ZKService ¶
type ZKService struct { Config // contains filtered or unexported fields }
ZKService 注册处理器在线信息等
func (*ZKService) CreateIfNotExists ¶
CreateIfNotExists 一层层检查,如果不存在则创建
func (*ZKService) GetChildren ¶
GetChildren 查询子节点
func (*ZKService) GetServers ¶
func (*ZKService) WatchChildren ¶
func (this_ *ZKService) WatchChildren(path string, listen func(data *WatchChildrenListenData) (finish bool)) (err error)
WatchChildren 监听子节点 子节点 新增 删除
Click to show internal directories.
Click to hide internal directories.