cluster

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2020 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Member

type Member struct {

	// UpdateChan is used to publish leadership updates to the server. This allows the server to
	// coordinate tasks such as scaling state garbage collection and the autoscaler, both of which
	// should only be run by the leader.
	UpdateChan chan *MembershipUpdate
	// contains filtered or unexported fields
}

func NewMember

func NewMember(log zerolog.Logger, store cluster.Backend, addr, advAddr, name string) (*Member, error)

func (*Member) ClearLeadership

func (m *Member) ClearLeadership()

ClearLeadership is used to coordinate the shutdown of the cluster membership processes so we can exist cleanly. This allows other servers to quickly take over as leader and therefore resume cluster operations.

func (*Member) IsHA

func (m *Member) IsHA() bool

func (*Member) Leader

func (m *Member) Leader() (bool, string, string, error)

Leader is used to identify the clusters currently recognised leader and identify the associated HTTP addresses.

func (*Member) RunLeadershipLoop

func (m *Member) RunLeadershipLoop()

type MembershipUpdate

type MembershipUpdate struct {

	// IsLeader is used to determine whether or not the Sherpa server is acting as the cluster
	// leader.
	IsLeader bool

	// Msg is an optional message to pass which can be useful when logging update events.
	Msg string
}

MembershipUpdate is the information used to update the server about leadership changes.

Jump to

Keyboard shortcuts

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