registry

package module
v0.0.0-...-88539b9 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

README

GogoRegistry

介绍

应用于gogo-cache的服务注册中心,预计将兼容多种注册中心组件

基于zookeeper的服务注册中心
  • 将服务注册于znode上,利用zookeeper的watch机制,当注册节点发生变动时,自动推送当前注册表给客户端,
  • 利用zookeeper的会话机制,监视节点的健康状况,结合服务注册功能,实现自动剔除离线节点

TODO

基于etcd的服务注册中心
基于Cousel的服务注册中心

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZooKeeperRegistry

type ZooKeeperRegistry struct {
	Host []string
}

func (*ZooKeeperRegistry) Discovery

func (z *ZooKeeperRegistry) Discovery(parent string) (chan []string, chan error)

Discovery 监听目标节点,放回两个channel,一个是变化以后的子节点快照,一个是错误信息

func (*ZooKeeperRegistry) Register

func (z *ZooKeeperRegistry) Register(parent, child string, data []byte) (err error)

Register 注册节点,向目标主机的目标路径注册节点

Jump to

Keyboard shortcuts

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