voting

package
v0.0.0-...-e490d57 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByVotes

type ByVotes []*Result

func (ByVotes) Len

func (s ByVotes) Len() int

func (ByVotes) Less

func (s ByVotes) Less(i, j int) bool

func (ByVotes) Swap

func (s ByVotes) Swap(i, j int)

type Poll

type Poll interface {
	Vote(choice string) error
	Results() ([]*Result, error)
}

func NewPoll

func NewPoll() Poll

type Result

type Result struct {
	Shortcode string `json:"shortcode"`
	NumVotes  int    `json:"votes"`
}

Jump to

Keyboard shortcuts

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