Help us shape the future of Go! Take the 2026 Go Developer Survey

simelection

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

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