vote

package
v1.0.0-alpha.21 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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