election

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Component = &component.Component{
	Name: "cluster.election",
	Dependencies: component.Components{
		runner.Component,
		election.Component,
	},
	Init: component.StepFunc(func(container container.Container) error {
		return container.Provide(NewElection)
	}),
	Execute: component.StepFunc(func(container container.Container) error {
		return container.Invoke(func(m cluster.Manager, e *Election) {
			m.OnAddPeer().Subscribe(e.onAddPeer)
			m.OnDeletingPeer().Subscribe(e.onDeletingPeer)
			m.OnMasterDisconnection().Subscribe(e.onMasterDisconnection)
			m.OnMasterCandidateConnect().Subscribe(e.onMasterCandidateConnect)
			m.OnChangeMaster().Subscribe(e.onChangeMaster)
		})
	}),
}

Functions

This section is empty.

Types

type Election

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

func NewElection

func NewElection(
	config *election.Config,
	m cluster.Manager,
	runner runner.Runner,
	logger logger.Logger,
) *Election

func (*Election) AddBulletin

func (e *Election) AddBulletin(b *domain.Bulletin) error

func (*Election) AgeSync

func (e *Election) AgeSync(term uint64)

func (*Election) Close

func (e *Election) Close() error

func (*Election) Name

func (e *Election) Name() string

func (*Election) Process

func (e *Election) Process(ctx context.Context) error

func (*Election) RunVote

func (e *Election) RunVote()

Jump to

Keyboard shortcuts

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