package simelection

import "github.com/google/trillian/docs/storage/commit_log/simelection"

Package simelection simulates a master election.

Index

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.

Source Files

election.go

Version
v1.7.1 (latest)
Published
Jan 9, 2025
Platform
linux/amd64
Imports
1 packages
Last checked
5 days ago

Tools for package owners.