commands

package
v0.0.0-...-3fe642c Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPollAlreadyExists returned if a newly generated poll id already exists
	ErrPollAlreadyExists = errors.New("Error creating poll, id already exists")
	// ErrPollNotFound returned if a poll was expected to exist but could not
	// be found
	ErrPollNotFound = errors.New("Poll not found")
)
View Source
var (
	// ErrNotImplemented place holder error until a command is implemented
	ErrNotImplemented = errors.New("Command not implemented")
)

Functions

This section is empty.

Types

type CastBallot

type CastBallot struct{}

CastBallot adds a vote to the poll

func (CastBallot) Run

func (c CastBallot) Run() error

Run executes CastBallot command

type ClosePoll

type ClosePoll struct {
	ID string
	// contains filtered or unexported fields
}

ClosePoll closes a poll so that no more ballots are accepted

func (ClosePoll) Run

func (c ClosePoll) Run() error

Run executes ClosePoll command

type Command

type Command interface {
	Run() error
}

Command simple interface for running a command.

func NewClosePoll

func NewClosePoll(
	eventStore eventstore.EventStore,
	eventManager eventmanager.EventManager,
	id string,
) Command

NewClosePoll initializes a new ClosePoll command for execution

func NewCreatePoll

func NewCreatePoll(
	eventStore eventstore.EventStore,
	eventManager eventmanager.EventManager,
	id string,
	issues []model.Issue,
) Command

NewCreatePoll initializes a new CreatePoll command for execution.

func NewOpenPoll

func NewOpenPoll(
	eventStore eventstore.EventStore,
	eventManager eventmanager.EventManager,
	id string,
) Command

NewOpenPoll initializes a new OpenPoll command for execution

type CreatePoll

type CreatePoll struct {
	ID     string
	Issues []model.Issue
	// contains filtered or unexported fields
}

CreatePoll creates a new poll.

func (CreatePoll) Run

func (c CreatePoll) Run() error

Run executes CreatePoll command

type OpenPoll

type OpenPoll struct {
	ID string
	// contains filtered or unexported fields
}

OpenPoll opens a poll for accepting ballots

func (OpenPoll) Run

func (o OpenPoll) Run() error

Run executes OpenPoll command

Jump to

Keyboard shortcuts

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