registry

package
v0.0.0-...-1fef4f5 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2022 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

	Stop()
}

Registry Extension - Registry

type Service

type Service struct {
	EventType uint32 // EventType: 0 => PUT, 1 => DELETE
	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