Documentation
¶
Overview ¶
Package vote provides functionality around reading and writing votes.
Index ¶
Constants ¶
View Source
const (
// DBName is the name of the database for the votes API.
DBName = "votes"
)
Variables ¶
This section is empty.
Functions ¶
func CreateTableIfNotExist ¶
CreateTableIfNotExist creates the "votes" table if it does not exist already.
Types ¶
type DB ¶
type DB interface {
Store(in VoteInput) error
BatchStore(in []VoteInput) error
Result(voterID string) (vote string, err error)
Results() (results []ResultCount, err error)
}
DB is the interface for all the operations allowed on votes.
type ResultCount ¶
ResultCount is a pair of a vote result and the sum of votes for the result.
Click to show internal directories.
Click to hide internal directories.