vote

package
v1.0.0-alpha.11 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockedRank

type MockedRank int

MockedRank is a mocked rank implementation that is used for testing.

func (MockedRank) Compare

func (m MockedRank) Compare(other MockedRank) int

Compare compares the MockedRank to another MockedRank.

type Vote

type Vote[Rank constraints.Comparable[Rank]] struct {
	// Voter is the identity of the voter.
	Voter account.SeatIndex

	// Rank is the rank of the voter.
	Rank Rank
	// contains filtered or unexported fields
}

Vote represents a vote that is cast by a voter.

func NewVote

func NewVote[Rank constraints.Comparable[Rank]](voter account.SeatIndex, rank Rank) *Vote[Rank]

NewVote creates a new vote.

func (*Vote[Rank]) IsLiked

func (v *Vote[Rank]) IsLiked() bool

IsLiked returns true if the vote is "positive" (voting "for something").

func (*Vote[Rank]) WithLiked

func (v *Vote[Rank]) WithLiked(liked bool) *Vote[Rank]

WithLiked returns a copy of the vote with the given liked value.

Jump to

Keyboard shortcuts

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