poll

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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DatabaseName = "voting_poll"
)

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) Create

func (h DefaultService) Create(req voting.Poll) (voting.Poll, error)

func (DefaultService) End

func (h DefaultService) End(shortId string, serverId string) (voting.Poll, error)

func (DefaultService) Open added in v0.3.4

func (h DefaultService) Open(shortId string, serverId string, expires time.Time) (voting.OpenPollResult, error)

func (DefaultService) Option

func (h DefaultService) Option(id string) (voting.Option, error)

func (DefaultService) Poll

func (h DefaultService) Poll(shortId string, serverId string) (voting.Poll, error)

func (DefaultService) PollCreator

func (h DefaultService) PollCreator(shortId string, serverId string) (string, error)

func (DefaultService) UniqueOptions

func (h DefaultService) UniqueOptions(pollId string, optionIds []string) ([]voting.Option, error)

type Repository

type Repository interface {
	Migrate() error
	CreatePoll(voting.Poll) (voting.Poll, error)
	Poll(shortId string, serverId string) (voting.Poll, error)
	PollCreator(shortId string, serverId string) (string, error)
	Option(id string) (voting.Option, error)
	Options(pollId string) ([]voting.Option, error)
	EndPoll(pollShortId, serverId string) (voting.Poll, error)
	OpenPoll(pollShortId, serverId string, expires time.Time) (voting.Poll, error)
	UniqueOptions(pollId string, optionIds []string) ([]voting.Option, 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