simelection

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 1 Imported by: 12

Documentation

Overview

Package simelection simulates a master election.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Election

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

Election is a (flawed) simulated mastership election, which can be made to report multiple masters at the same time.

func (*Election) IsMaster

func (e *Election) IsMaster(who string) bool

IsMaster indicates whether the given name is master.

func (*Election) Masters

func (e *Election) Masters() []string

Masters returns the current set of masters. There should be only one, but bugs happen...

func (*Election) SetMaster

func (e *Election) SetMaster(who string)

SetMaster sets a single master.

func (*Election) SetMasters

func (e *Election) SetMasters(who []string)

SetMasters sets multiple masters.

Jump to

Keyboard shortcuts

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