ballot

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DatabaseName = "voting_ballot"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultService

type DefaultService struct {
	// contains filtered or unexported fields
}

func NewDefaultService

func NewDefaultService(logger zerolog.Logger, repository Repository) DefaultService

func (DefaultService) Submit

func (s DefaultService) Submit(ballot voting.Ballot) (voting.BallotResult, error)

func (DefaultService) VoterBallot

func (s DefaultService) VoterBallot(pollId string, voterId string) ([]string, error)

func (DefaultService) VoterCount added in v0.0.2

func (s DefaultService) VoterCount(pollId string) (int64, error)

func (DefaultService) VoterIds

func (s DefaultService) VoterIds(pollId string) ([]string, error)

type Repository

type Repository interface {
	Migrate() error
	VoidBallotOptions(pollId string, voterId string) error
	CreateBallotOptions(ballot voting.Ballot) error
	VoterCount(pollId string) (int64, error)
	VoterIds(pollId string) ([]string, error)
	VoterBallot(pollId string, voterId string) ([]string, error)
}

func NewRepository

func NewRepository(url string) (Repository, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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