discovery

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ETCDSchema = "etcd"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ETCDDiscovery

type ETCDDiscovery struct {
	// contains filtered or unexported fields
}

func (*ETCDDiscovery) BuildTarget

func (discovery *ETCDDiscovery) BuildTarget(serviceName string) string

func (*ETCDDiscovery) Discovery

func (discovery *ETCDDiscovery) Discovery(serviceName string) (infos []ServiceInfo, err error)

func (*ETCDDiscovery) Register

func (discovery *ETCDDiscovery) Register(stopCh <-chan struct{}, info ServiceInfo) error

func (*ETCDDiscovery) Resolver

func (discovery *ETCDDiscovery) Resolver(serviceName string)

type Instance

type Instance interface {
	// Register a new service
	Register(stopCh <-chan struct{}, info ServiceInfo) error
	Discovery(serviceName string) (infos []ServiceInfo, err error)

	Resolver(serviceName string)
	BuildTarget(serviceName string) string
}

func NewETCDDiscovery

func NewETCDDiscovery(endpoints []string, namespace string, ttl time.Duration) Instance

type ServiceInfo

type ServiceInfo struct {
	Name   string
	Addr   string
	Weight int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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