discovery

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	PublicAddr  string
	PrivateAddr string
}

Node is a public-private address pair.

type Strategy

type Strategy interface {
	DiscoverNodes(ctx context.Context) ([]Node, error)
}

Strategy is the discovery strategy interface. DiscoverNodes may be called several times.

type StrategyDestroyer

type StrategyDestroyer interface {
	Destroy(ctx context.Context) error
}

StrategyDestroyer is an optional interface for a discovery strategy. If implemented, Destroy method will be called once during client shutdown.

type StrategyOptions

type StrategyOptions struct {
	Logger      logger.Logger
	UsePublicIP bool
}

StrategyOptions are passed to the Strategy's Start method.

type StrategyStarter

type StrategyStarter interface {
	Start(ctx context.Context, opts StrategyOptions) error
}

StrategyStarter is an optional interface for a discovery strategy. If implemented, Start will be called before DiscoverNodes method. Note that it may be called more than once if the previous start was not successful.

Jump to

Keyboard shortcuts

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