discovery

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAlreadyInitialized is used when attempting to re-initialize the discovery provider
	ErrAlreadyInitialized = errors.New("provider already initialized")
	// ErrNotInitialized is used when the provider is not initialized
	ErrNotInitialized = errors.New("provider not initialized")
	// ErrAlreadyRegistered is used when attempting to re-register the provider
	ErrAlreadyRegistered = errors.New("provider already registered")
	// ErrNotRegistered is used when attempting to de-register the provider
	ErrNotRegistered = errors.New("provider is not registered")
	// ErrInvalidConfig is used when the discovery provider configuration is invalid
	ErrInvalidConfig = errors.New("invalid discovery provider configuration")
)

Functions

This section is empty.

Types

type Node

type Node struct {
	// Name specifies the discovered node's Name
	Name string
	// Host specifies the discovered node's Host
	Host string
	// GossipPort
	GossipPort int
	// PeersPort
	PeersPort int
	// RemotingPort
	RemotingPort int
}

Node represents a discovered Node

func (Node) GossipAddress

func (n Node) GossipAddress() string

GossipAddress returns the node discovery address

func (Node) PeersAddress

func (n Node) PeersAddress() string

PeersAddress returns address the node's peers will use to connect to

type Provider

type Provider interface {
	// ID returns the service discovery provider name
	ID() string
	// Initialize initializes the service discovery provider.
	Initialize() error
	// Register registers the service discovery provider.
	Register() error
	// Deregister de-registers the service discovery provider.
	Deregister() error
	// DiscoverPeers returns a list discovered nodes' addresses.
	DiscoverPeers() ([]string, error)
	// Close closes the provider
	Close() error
}

Provider helps discover other running actor system in a cloud environment

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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