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: 0

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