zookeeper

package
v0.0.0-...-869c34b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZkManager

type ZkManager struct {
	// contains filtered or unexported fields
}

ZkManager ZkManager

func NewZkManager

func NewZkManager(hosts []string) *ZkManager

NewZkManager 创建NewZkManager

func (*ZkManager) Close

func (z *ZkManager) Close()

Close 关闭服务

func (*ZkManager) GetConnect

func (z *ZkManager) GetConnect() error

GetConnect 连接 zk 服务器

func (*ZkManager) GetPathData

func (z *ZkManager) GetPathData(nodePath string) ([]byte, *zk.Stat, error)

GetPathData 获取配置

func (*ZkManager) GetServerListByPath

func (z *ZkManager) GetServerListByPath(path string) (list []string, err error)

GetServerListByPath 获取服务列表

func (*ZkManager) RegistServerPath

func (z *ZkManager) RegistServerPath(nodePath, host string) (err error)

RegistServerPath 创建临时节点 nodePath 主节点 host 要注册的子节点

func (*ZkManager) SetPathData

func (z *ZkManager) SetPathData(nodePath string, config []byte, version int32) (err error)

SetPathData 更新配置

func (*ZkManager) WatchPathData

func (z *ZkManager) WatchPathData(nodePath string) (chan []byte, chan error)

WatchPathData watch机制,监听节点值变化

func (*ZkManager) WatchServerListByPath

func (z *ZkManager) WatchServerListByPath(path string) (chan []string, chan error)

WatchServerListByPath watch机制,服务器有断开或者重连,收到消息

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL