Documentation ¶
Index ¶
- Constants
- func HandleClientRestart(r zkClientFacade)
- func StateToString(state zk.State) string
- func ValidateZookeeperClient(container zkClientFacade, opts ...Option) error
- type Option
- type Options
- type ZkEventListener
- type ZookeeperClient
- func (z *ZookeeperClient) Close()
- func (z *ZookeeperClient) Create(basePath string) error
- func (z *ZookeeperClient) Delete(basePath string) error
- func (z *ZookeeperClient) Done() <-chan struct{}
- func (z *ZookeeperClient) ExistW(zkPath string) (<-chan zk.Event, error)
- func (z *ZookeeperClient) GetChildren(path string) ([]string, error)
- func (z *ZookeeperClient) GetChildrenW(path string) ([]string, <-chan zk.Event, error)
- func (z *ZookeeperClient) GetContent(zkPath string) ([]byte, *zk.Stat, error)
- func (z *ZookeeperClient) HandleZkEvent(session <-chan zk.Event)
- func (z *ZookeeperClient) RegisterEvent(zkPath string, event *chan struct{})
- func (z *ZookeeperClient) RegisterTemp(basePath string, node string) (string, error)
- func (z *ZookeeperClient) RegisterTempSeq(basePath string, data []byte) (string, error)
- func (z *ZookeeperClient) UnregisterEvent(zkPath string, event *chan struct{})
- func (z *ZookeeperClient) ZkConnValid() bool
Constants ¶
View Source
const ( // ConnDelay connection delay interval ConnDelay = 3 // MaxFailTimes max fail times MaxFailTimes = 15 )
Variables ¶
This section is empty.
Functions ¶
func ValidateZookeeperClient ¶
ValidateZookeeperClient ...
Types ¶
type ZkEventListener ¶
type ZkEventListener struct {
// contains filtered or unexported fields
}
ZkEventListener ...
func NewZkEventListener ¶
func NewZkEventListener(client *ZookeeperClient) *ZkEventListener
NewZkEventListener ...
func (*ZkEventListener) ListenServiceEvent ¶
func (l *ZkEventListener) ListenServiceEvent(zkPath string, listener remoting.DataListener)
ListenServiceEvent is invoked by ZkConsumerRegistry::Register/ZkConsumerRegistry::get/ZkConsumerRegistry::getListener registry.go:Listen -> listenServiceEvent -> listenDirEvent -> ListenServiceNodeEvent
| --------> ListenServiceNodeEvent
func (*ZkEventListener) ListenServiceNodeEvent ¶
func (l *ZkEventListener) ListenServiceNodeEvent(zkPath string, listener ...remoting.DataListener) bool
ListenServiceNodeEvent ...
func (*ZkEventListener) SetClient ¶
func (l *ZkEventListener) SetClient(client *ZookeeperClient)
SetClient ...
type ZookeeperClient ¶
type ZookeeperClient struct { ZkAddrs []string sync.Mutex // for conn Conn *zk.Conn Timeout time.Duration Wait sync.WaitGroup // contains filtered or unexported fields }
ZookeeperClient ...
func NewMockZookeeperClient ¶
func NewMockZookeeperClient(name string, timeout time.Duration, opts ...Option) (*zk.TestCluster, *ZookeeperClient, <-chan zk.Event, error)
NewMockZookeeperClient ...
func (*ZookeeperClient) ExistW ¶
func (z *ZookeeperClient) ExistW(zkPath string) (<-chan zk.Event, error)
ExistW ...
func (*ZookeeperClient) GetChildren ¶
func (z *ZookeeperClient) GetChildren(path string) ([]string, error)
GetChildren ...
func (*ZookeeperClient) GetChildrenW ¶
GetChildrenW ...
func (*ZookeeperClient) GetContent ¶
GetContent ...
func (*ZookeeperClient) HandleZkEvent ¶
func (z *ZookeeperClient) HandleZkEvent(session <-chan zk.Event)
HandleZkEvent ...
func (*ZookeeperClient) RegisterEvent ¶
func (z *ZookeeperClient) RegisterEvent(zkPath string, event *chan struct{})
RegisterEvent ...
func (*ZookeeperClient) RegisterTemp ¶
func (z *ZookeeperClient) RegisterTemp(basePath string, node string) (string, error)
RegisterTemp ...
func (*ZookeeperClient) RegisterTempSeq ¶
func (z *ZookeeperClient) RegisterTempSeq(basePath string, data []byte) (string, error)
RegisterTempSeq ...
func (*ZookeeperClient) UnregisterEvent ¶
func (z *ZookeeperClient) UnregisterEvent(zkPath string, event *chan struct{})
UnregisterEvent ...
Click to show internal directories.
Click to hide internal directories.