registry

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type     EventType
	Key      string
	Instance Instance
}

type EventType

type EventType int
const (
	EventTypeUnknown EventType = iota
	EventTypeAdd
	EventTypeDelete
)

type Instance

type Instance struct {
	Name  string `yaml:"name" json:"name"`   // 实例名称
	Desc  string `yaml:"desc" json:"desc"`   // 注解
	Topic string `yaml:"topic" json:"topic"` // 建立 Topic 通道
}

type Registry

type Registry interface {
	Register(ctx context.Context, si Instance) error
	UnRegister(ctx context.Context, si Instance) error

	ListWorkers(ctx context.Context, name string) ([]Instance, error)
	Subscribe(name string) <-chan Event

	io.Closer
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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