Documentation
¶
Index ¶
- type BySnapshotVotes
- type ByVotes
- type CandidateStatus
- type MeekCandidate
- type MeekCandidates
- type MeekRound
- type MeekStv
- type Pool
- func (p *Pool) AddNewCandidates(candidates election.Candidates, scale int64)
- func (p *Pool) AddVotes(id string, votes int64)
- func (p *Pool) Almost() MeekCandidates
- func (p *Pool) Candidate(id string) *MeekCandidate
- func (p *Pool) CandidateSummaries() []election.CandidateSummary
- func (p *Pool) Candidates() MeekCandidates
- func (p *Pool) CandidatesWithStatus(status CandidateStatus) MeekCandidates
- func (p *Pool) Count() int
- func (p *Pool) Elect(id string) *MeekCandidate
- func (p *Pool) ElectAllNewlyElected()
- func (p *Pool) ElectHopeful()
- func (p *Pool) Elected() MeekCandidates
- func (p *Pool) ElectedCount() int
- func (p *Pool) Exclude(id string) *MeekCandidate
- func (p *Pool) ExcludeByName(name string) MeekCandidates
- func (p *Pool) ExcludeHopeful()
- func (p *Pool) ExcludeMany(m MeekCandidates)
- func (p *Pool) ExcludedCount() int
- func (p *Pool) Hopeful() MeekCandidates
- func (p *Pool) Lowest() MeekCandidates
- func (p *Pool) NewlyElect(id string)
- func (p *Pool) NewlyElected() MeekCandidates
- func (p *Pool) SetAlmost(id string)
- func (p *Pool) SetWeight(id string, weight int64)
- func (p *Pool) Snapshot() []MeekCandidate
- func (p *Pool) ZeroAllVotes()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BySnapshotVotes ¶ added in v0.2.0
type BySnapshotVotes []MeekCandidate
func (BySnapshotVotes) Len ¶ added in v0.2.0
func (c BySnapshotVotes) Len() int
func (BySnapshotVotes) Less ¶ added in v0.2.0
func (c BySnapshotVotes) Less(i, j int) bool
func (BySnapshotVotes) Swap ¶ added in v0.2.0
func (c BySnapshotVotes) Swap(i, j int)
type ByVotes ¶
type ByVotes MeekCandidates
type CandidateStatus ¶
type CandidateStatus string
const ( Elected CandidateStatus = "Elected" NewlyElected CandidateStatus = "NewlyElected" Hopeful CandidateStatus = "Hopeful" Excluded CandidateStatus = "Excluded" Almost CandidateStatus = "Almost" )
type MeekCandidate ¶
type MeekCandidate struct {
election.Candidate
Status CandidateStatus
Weight int64
Votes int64
}
func (*MeekCandidate) AsCandidate ¶
func (meekCandidate *MeekCandidate) AsCandidate() election.Candidate
type MeekCandidates ¶
type MeekCandidates []*MeekCandidate
func (MeekCandidates) AsCandidates ¶
func (meekCandidates MeekCandidates) AsCandidates() election.Candidates
func (MeekCandidates) Snapshot ¶ added in v0.2.3
func (m MeekCandidates) Snapshot() []MeekCandidate
func (MeekCandidates) SortedNames ¶ added in v0.2.0
func (m MeekCandidates) SortedNames() []string
func (MeekCandidates) TotalVotes ¶ added in v0.2.0
func (m MeekCandidates) TotalVotes() int64
type MeekRound ¶
type MeekRound struct {
Number int
Excess int64
Surplus int64
AnyElected bool
Snapshot []MeekCandidate
}
type MeekStv ¶
func NewMeekStv ¶
func NewMeekStv() MeekStv
type Pool ¶
type Pool struct {
MeekCandidates MeekCandidates
}
func (*Pool) AddNewCandidates ¶
func (p *Pool) AddNewCandidates(candidates election.Candidates, scale int64)
func (*Pool) Almost ¶
func (p *Pool) Almost() MeekCandidates
func (*Pool) Candidate ¶
func (p *Pool) Candidate(id string) *MeekCandidate
func (*Pool) CandidateSummaries ¶ added in v0.1.0
func (p *Pool) CandidateSummaries() []election.CandidateSummary
func (*Pool) Candidates ¶
func (p *Pool) Candidates() MeekCandidates
func (*Pool) CandidatesWithStatus ¶ added in v0.2.0
func (p *Pool) CandidatesWithStatus(status CandidateStatus) MeekCandidates
func (*Pool) Elect ¶
func (p *Pool) Elect(id string) *MeekCandidate
func (*Pool) ElectAllNewlyElected ¶
func (p *Pool) ElectAllNewlyElected()
func (*Pool) ElectHopeful ¶
func (p *Pool) ElectHopeful()
func (*Pool) Elected ¶
func (p *Pool) Elected() MeekCandidates
func (*Pool) ElectedCount ¶
func (*Pool) Exclude ¶
func (p *Pool) Exclude(id string) *MeekCandidate
func (*Pool) ExcludeByName ¶
func (p *Pool) ExcludeByName(name string) MeekCandidates
func (*Pool) ExcludeHopeful ¶
func (p *Pool) ExcludeHopeful()
func (*Pool) ExcludeMany ¶ added in v0.2.0
func (p *Pool) ExcludeMany(m MeekCandidates)
func (*Pool) ExcludedCount ¶
func (*Pool) Hopeful ¶
func (p *Pool) Hopeful() MeekCandidates
func (*Pool) Lowest ¶
func (p *Pool) Lowest() MeekCandidates
func (*Pool) NewlyElect ¶
func (*Pool) NewlyElected ¶
func (p *Pool) NewlyElected() MeekCandidates
func (*Pool) Snapshot ¶ added in v0.2.0
func (p *Pool) Snapshot() []MeekCandidate
func (*Pool) ZeroAllVotes ¶
func (p *Pool) ZeroAllVotes()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.