simelection

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 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