registry

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	IP   string
	Port uint64
}

type EventListener

type EventListener interface {
	OnEvent(service []*Service) error
}

type EventType

type EventType int

EventType means SourceObjectEventType

type Registry

type Registry interface {
	//注册服务
	Register(addr *Address) error
	//取消注册
	UnRegister(addr *Address) error
	//查询服务地址
	Lookup() ([]string, error)

	//订阅
	Subscribe(EventListener) error

	//取消订阅
	UnSubscribe(EventListener) error
}

Registry Extension - Registry

type Service

type Service struct {
	IP   string
	Port uint64
	Name string
}

订阅获取到的服务信息

type ServiceEvent

type ServiceEvent struct {
	Action EventType
	// contains filtered or unexported fields
}

ServiceEvent includes create, update, delete event

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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