Documentation
¶
Overview ¶
Package memory implements the vote.Backend interface.
All data are saved in memory.
Index ¶
- type Backend
- func (b *Backend) AssertUserHasVoted(t *testing.T, pollID, userID int)
- func (b *Backend) Clear(ctx context.Context, pollID int) error
- func (b *Backend) ClearAll(ctx context.Context) error
- func (b *Backend) LiveVotes(ctx context.Context) (map[int]map[int][]byte, error)
- func (b *Backend) Start(ctx context.Context, pollID int) error
- func (b *Backend) Stop(ctx context.Context, pollID int) ([][]byte, []int, error)
- func (b *Backend) String() string
- func (b *Backend) Vote(ctx context.Context, pollID int, userID int, vote []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend is a vote backend that holds the data in memory.
func (*Backend) AssertUserHasVoted ¶
AssertUserHasVoted is a method for the tests to check, if a user has voted.
func (*Backend) LiveVotes ¶
LiveVotes returns all votes from each user. Returns nil on non named votes.
Click to show internal directories.
Click to hide internal directories.