vote

package
v0.8.8 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ITicket

type ITicket interface {
	Serialize() []byte
}

ITicket Interface for ticket of vote

type Vote

type Vote struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Vote Defined vote struct

func NewVote

func NewVote() *Vote

NewVote Create vote instance

func (*Vote) Add

func (v *Vote) Add(voter string, ticket ITicket)

Add Add ticket

func (*Vote) Clear

func (v *Vote) Clear()

Clear Init

func (*Vote) IterTicket

func (v *Vote) IterTicket(function func(ITicket, int))

IterTicket Iter by ticket

func (*Vote) IterVoter

func (v *Vote) IterVoter(function func(string, ITicket))

IterVoter Iter by voter

func (*Vote) Size

func (v *Vote) Size() int

Size Len of tickets

func (*Vote) String

func (v *Vote) String() string

func (*Vote) Voter

func (v *Vote) Voter() (int, ITicket)

Voter Get ticket of max num

func (*Vote) VoterByTicket

func (v *Vote) VoterByTicket(ticket ITicket) int

VoterByTicket Get num of ticket

func (*Vote) VoterByVoter

func (v *Vote) VoterByVoter(voter string) (int, ITicket)

VoterByVoter Get ticket of voter

Jump to

Keyboard shortcuts

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