discovery

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	Addr string
}

type EndpointWatchHandler added in v0.3.2

type EndpointWatchHandler func([]Endpoint)

EndpointWatchHandler consumes the latest endpoint snapshot for a service key.

type Node

type Node struct {
	Key    string
	Server string
}

func (*Node) String

func (n *Node) String() string

type Registerer added in v0.2.10

type Registerer interface {
	scene.Named
	Register(name string, endpoint Endpoint) (*Node, error)
	Deregister(node *Node) error
}

type Resolver added in v0.3.2

type Resolver interface {
	Resolve(ctx context.Context, key string) ([]Endpoint, error)
	// Watch registers a callback which will be invoked whenever the endpoints change.
	// The returned cancel func should be called to stop watching.
	Watch(ctx context.Context, key string, handler EndpointWatchHandler) (context.CancelFunc, error)
}

Resolver returns available endpoints for a given service key.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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