Help us shape the future of Go! Take the 2026 Go Developer Survey

cluster

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

Cluster represents a cluster management/discovery mechanism using gossip.

func New

func New(port int) *Cluster

New creates a new gossip cluster.

func (*Cluster) Addr

func (c *Cluster) Addr() string

Addr returns the advertised address

func (*Cluster) Close

func (c *Cluster) Close() error

Close closes the gossip

func (*Cluster) Join

func (c *Cluster) Join(addresses ...string) error

Join attempts to join a cluster.

func (*Cluster) JoinHostname

func (c *Cluster) JoinHostname(name string) error

JoinHostname attempts to join all of the nodes behind a hostname

func (*Cluster) Members

func (c *Cluster) Members() (nodes []string)

Members returns the current set of nodes available.

type Membership

type Membership interface {
	Members() []string
	Addr() string
}

Membership represents a contract which returns a list of IP addresses.

Jump to

Keyboard shortcuts

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