Documentation ¶
Index ¶
- type PlayerRepository
- func (pr *PlayerRepository) GetAllPlayers() (map[string]*switchers.Player, error)
- func (pr *PlayerRepository) GetAllTrumps() (map[string]*switchers.Player, error)
- func (pr *PlayerRepository) GetOrCreatePlayer(ID string) (*switchers.Player, bool, error)
- func (pr *PlayerRepository) GetTop(count int) ([]*switchers.Player, error)
- func (pr *PlayerRepository) IncreaseScore(player *switchers.Player) error
- func (pr *PlayerRepository) SetModeratingTeamIndex(player *switchers.Player, index int) error
- func (pr *PlayerRepository) SetName(player *switchers.Player, name string) error
- func (pr *PlayerRepository) SetPaused(player *switchers.Player, paused bool) error
- func (pr *PlayerRepository) SetState(player *switchers.Player, state string) error
- func (pr *PlayerRepository) SetTrump(player *switchers.Player, trump bool) error
- type Repository
- type RoundRepository
- func (rr *RoundRepository) AddTeamMemberToActual(round *switchers.Round, index int, playerID string) error
- func (rr *RoundRepository) AddTeamMemberToMissing(round *switchers.Round, index int, playerID string) error
- func (rr *RoundRepository) DeactivateRound(round *switchers.Round) error
- func (rr *RoundRepository) GetActiveRound() (*switchers.Round, error)
- func (rr *RoundRepository) SaveActiveRound(round *switchers.Round) error
- func (rr *RoundRepository) SetTeamActualDeadline(round *switchers.Round, index int, deadline time.Time) error
- func (rr *RoundRepository) SetTeamAnswer(round *switchers.Round, index int, answer *switchers.Answer) error
- func (rr *RoundRepository) SetTeamMissingPlayersDeadline(round *switchers.Round, index int, deadline time.Time) error
- func (rr *RoundRepository) SetTeamState(round *switchers.Round, index int, state string) error
- type TaskRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PlayerRepository ¶
type PlayerRepository struct {
Repository
}
PlayerRepository persists player information in Firebase
func (*PlayerRepository) GetAllPlayers ¶
func (pr *PlayerRepository) GetAllPlayers() (map[string]*switchers.Player, error)
GetAllPlayers retrieves all players
func (*PlayerRepository) GetAllTrumps ¶
func (pr *PlayerRepository) GetAllTrumps() (map[string]*switchers.Player, error)
GetAllTrumps retrieves all Trumps
func (*PlayerRepository) GetOrCreatePlayer ¶
GetOrCreatePlayer retrieves player profile, creating it if necessary
func (*PlayerRepository) GetTop ¶
func (pr *PlayerRepository) GetTop(count int) ([]*switchers.Player, error)
GetTop returns top scoring players
func (*PlayerRepository) IncreaseScore ¶
func (pr *PlayerRepository) IncreaseScore(player *switchers.Player) error
IncreaseScore increases player score
func (*PlayerRepository) SetModeratingTeamIndex ¶
func (pr *PlayerRepository) SetModeratingTeamIndex(player *switchers.Player, index int) error
SetModeratingTeamIndex sets player Trump
func (*PlayerRepository) SetName ¶
func (pr *PlayerRepository) SetName(player *switchers.Player, name string) error
SetName sets player name
func (*PlayerRepository) SetPaused ¶
func (pr *PlayerRepository) SetPaused(player *switchers.Player, paused bool) error
SetPaused sets player paused
type Repository ¶
type Repository struct { FirebaseURL string FirebaseToken string // contains filtered or unexported fields }
Repository is a generic holder for auth and url parameters
type RoundRepository ¶
type RoundRepository struct {
Repository
}
RoundRepository persists round information in Firebase
func (*RoundRepository) AddTeamMemberToActual ¶
func (rr *RoundRepository) AddTeamMemberToActual(round *switchers.Round, index int, playerID string) error
AddTeamMemberToActual adds gathering player to actual team
func (*RoundRepository) AddTeamMemberToMissing ¶
func (rr *RoundRepository) AddTeamMemberToMissing(round *switchers.Round, index int, playerID string) error
AddTeamMemberToMissing adds gathering player to missing
func (*RoundRepository) DeactivateRound ¶
func (rr *RoundRepository) DeactivateRound(round *switchers.Round) error
DeactivateRound puts active round into archive
func (*RoundRepository) GetActiveRound ¶
func (rr *RoundRepository) GetActiveRound() (*switchers.Round, error)
GetActiveRound looks up active round and returns it
func (*RoundRepository) SaveActiveRound ¶
func (rr *RoundRepository) SaveActiveRound(round *switchers.Round) error
SaveActiveRound saves active round
func (*RoundRepository) SetTeamActualDeadline ¶
func (rr *RoundRepository) SetTeamActualDeadline(round *switchers.Round, index int, deadline time.Time) error
SetTeamActualDeadline sets deadline for actual task
func (*RoundRepository) SetTeamAnswer ¶
func (rr *RoundRepository) SetTeamAnswer(round *switchers.Round, index int, answer *switchers.Answer) error
SetTeamAnswer sets team answer for actual task
func (*RoundRepository) SetTeamMissingPlayersDeadline ¶
func (rr *RoundRepository) SetTeamMissingPlayersDeadline(round *switchers.Round, index int, deadline time.Time) error
SetTeamMissingPlayersDeadline sets team waiting deadline after quorum
func (*RoundRepository) SetTeamState ¶
SetTeamState sets team state
type TaskRepository ¶
type TaskRepository struct {
Repository
}
TaskRepository persists task information in Firebase
func (*TaskRepository) GetAllActualTasks ¶
func (tr *TaskRepository) GetAllActualTasks() ([]switchers.ActualTask, error)
GetAllActualTasks retrieves all gathering tasks
func (*TaskRepository) GetAllGatheringTasks ¶
func (tr *TaskRepository) GetAllGatheringTasks() (map[string][]switchers.GatheringTask, error)
GetAllGatheringTasks retrieves all gathering tasks