Documentation ¶
Index ¶
- Constants
- type DefaultService
- func (h DefaultService) Create(req voting.Poll) (voting.Poll, error)
- func (h DefaultService) End(shortId string, serverId string) (voting.Poll, error)
- func (h DefaultService) Open(shortId string, serverId string, expires time.Time) (voting.OpenPollResult, error)
- func (h DefaultService) Option(id string) (voting.Option, error)
- func (h DefaultService) Poll(shortId string, serverId string) (voting.Poll, error)
- func (h DefaultService) PollCreator(shortId string, serverId string) (string, error)
- func (h DefaultService) UniqueOptions(pollId string, optionIds []string) ([]voting.Option, error)
- type Repository
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) Open ¶ added in v0.3.4
func (h DefaultService) Open(shortId string, serverId string, expires time.Time) (voting.OpenPollResult, error)
func (DefaultService) PollCreator ¶
func (h DefaultService) PollCreator(shortId string, serverId string) (string, error)
func (DefaultService) UniqueOptions ¶
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)
Click to show internal directories.
Click to hide internal directories.