sd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discovery

type Discovery interface {
	GetService(ctx context.Context, serviceName string) ([]*ServiceInfo, error)
	NewWatcher(ctx context.Context, serviceName string) (Watcher, error)
}

Discovery discovers instance information from a service discovery system

type Operation

type Operation uint8
const (
	Add Operation = iota
	Delete
)

type Registrar

type Registrar interface {
	Register(ctx context.Context, service *ServiceInfo) error
	Deregister(ctx context.Context, service *ServiceInfo) error
}

Registrar registers instance information to a service discovery system

type ServiceInfo

type ServiceInfo struct {
	Name     string
	Scheme   string
	Addr     string
	Metadata map[string]string
}

type Update

type Update struct {
	Op          Operation
	Key         string
	ServiceInfo *ServiceInfo
}

type Watcher

type Watcher <-chan []*Update

Jump to

Keyboard shortcuts

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