persistence

package
v0.0.0-...-d9656e6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamoDBPersistence

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

func NewDynamoDBPersistence

func NewDynamoDBPersistence() *DynamoDBPersistence

func (*DynamoDBPersistence) CreateRound

func (db *DynamoDBPersistence) CreateRound(round *Round)

func (*DynamoDBPersistence) CreateRoundTable

func (db *DynamoDBPersistence) CreateRoundTable()

func (*DynamoDBPersistence) FetchRound

func (db *DynamoDBPersistence) FetchRound(roundID string) *Round

func (*DynamoDBPersistence) UpdateParticipantsAndCurrentCandidate

func (db *DynamoDBPersistence) UpdateParticipantsAndCurrentCandidate(updatedRound *Round) *Round

type Participant

type Participant struct {
	UUID       string `dynamo:"uuid"`
	Name       string `dynamo:"name"`
	RoundCount int    `dynamo:"round_count"`
}

type Persistence

type Persistence interface {
	CreateRoundTable()
	CreateRound(round *Round)
	FetchRound(roundID string) *Round
	UpdateParticipantsAndCurrentCandidate(updatedRound *Round) *Round
}

type Round

type Round struct {
	URL              string        `dynamo:"url,hash"`
	Participants     []Participant `dynamo:"participants"`
	CurrentCandidate string        `dynamo:"current_candidate"`
	CreateDate       time.Time     `dynamo:"create_date"`
	UpdateDate       time.Time     `dynamo:"update_date"`
}

Jump to

Keyboard shortcuts

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