Documentation ¶
Index ¶
- type ServiceDiscovery
- func (s *ServiceDiscovery) Close() error
- func (s *ServiceDiscovery) DelServiceList(key string)
- func (s *ServiceDiscovery) GetService(prefix string) []string
- func (s *ServiceDiscovery) GetServices() []string
- func (s *ServiceDiscovery) SetServiceList(key, val string)
- func (s *ServiceDiscovery) WatchService(prefix string) error
- type ServiceRegister
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceDiscovery ¶
type ServiceDiscovery struct {
// contains filtered or unexported fields
}
ServiceDiscovery 服务发现
func NewServiceDiscovery ¶
func NewServiceDiscovery(endpoints []string, logger *zap.Logger) *ServiceDiscovery
NewServiceDiscovery 新建发现服务
func (*ServiceDiscovery) DelServiceList ¶
func (s *ServiceDiscovery) DelServiceList(key string)
DelServiceList 删除服务地址
func (*ServiceDiscovery) GetService ¶
func (s *ServiceDiscovery) GetService(prefix string) []string
func (*ServiceDiscovery) GetServices ¶
func (s *ServiceDiscovery) GetServices() []string
GetServices 获取服务地址
func (*ServiceDiscovery) SetServiceList ¶
func (s *ServiceDiscovery) SetServiceList(key, val string)
SetServiceList 新增服务地址
func (*ServiceDiscovery) WatchService ¶
func (s *ServiceDiscovery) WatchService(prefix string) error
WatchService 初始化服务列表和监视
type ServiceRegister ¶
type ServiceRegister struct {
// contains filtered or unexported fields
}
ServiceRegister 创建租约注册服务
func NewServiceRegister ¶
func NewServiceRegister(endpoints []string, key, val string, lease int64, logger *zap.Logger) (*ServiceRegister, error)
NewServiceRegister 新建注册服务
func (*ServiceRegister) ListenLeaseRespChan ¶
func (s *ServiceRegister) ListenLeaseRespChan()
ListenLeaseRespChan 监听 续租情况
Click to show internal directories.
Click to hide internal directories.