Documentation ¶
Index ¶
- Variables
- type Config
- type IService
- type Info
- type NodeEvent
- type NodeInfo
- type Service
- func (this_ *Service) Create(path string, data []byte, mode int32) (err error)
- func (this_ *Service) CreateIfNotExists(path string, data []byte) (err error)
- func (this_ *Service) Delete(path string) (err error)
- func (this_ *Service) Exists(path string) (isExist bool, err error)
- func (this_ *Service) Get(path string) (info *NodeInfo, err error)
- func (this_ *Service) GetChildren(path string) (children []string, err error)
- func (this_ *Service) GetConn() *zk.Conn
- func (this_ *Service) GetServers() []string
- func (this_ *Service) Info() (info *Info, err error)
- func (this_ *Service) Set(path string, data []byte) (err error)
- func (this_ *Service) Stat(path string) (info *StatInfo, err error)
- func (this_ *Service) Stop()
- func (this_ *Service) WatchChildren(path string, listen func(data *WatchChildrenListenData) (finish bool)) (err error)
- type StatInfo
- type WatchChildrenListenData
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 IService ¶ added in v0.0.5
type IService interface { Stop() Create(path string, data []byte, mode int32) (err error) Info() (info *Info, err error) Set(path string, data []byte) (err error) CreateIfNotExists(path string, data []byte) (err error) Exists(path string) (isExist bool, err error) Get(path string) (info *NodeInfo, err error) Stat(path string) (info *StatInfo, err error) GetChildren(path string) (children []string, err error) Delete(path string) (err error) WatchChildren(path string, listen func(data *WatchChildrenListenData) (finish bool)) (err error) }
type Service ¶ added in v0.0.5
type Service struct { Config // contains filtered or unexported fields }
Service 注册处理器在线信息等
func (*Service) CreateIfNotExists ¶ added in v0.0.5
CreateIfNotExists 一层层检查,如果不存在则创建
func (*Service) GetChildren ¶ added in v0.0.5
GetChildren 查询子节点
func (*Service) GetServers ¶ added in v0.0.5
func (*Service) WatchChildren ¶ added in v0.0.5
func (this_ *Service) WatchChildren(path string, listen func(data *WatchChildrenListenData) (finish bool)) (err error)
WatchChildren 监听子节点 子节点 新增 删除
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 ¶
Click to show internal directories.
Click to hide internal directories.