firebase

package
v0.0.0-...-408557b Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

func (pr *PlayerRepository) GetOrCreatePlayer(ID string) (*switchers.Player, bool, error)

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

func (*PlayerRepository) SetState

func (pr *PlayerRepository) SetState(player *switchers.Player, state string) error

SetState sets player state

func (*PlayerRepository) SetTrump

func (pr *PlayerRepository) SetTrump(player *switchers.Player, trump bool) error

SetTrump sets player Trump

type Repository

type Repository struct {
	FirebaseURL   string
	FirebaseToken string
	// contains filtered or unexported fields
}

Repository is a generic holder for auth and url parameters

func (*Repository) Start

func (r *Repository) Start() error

Start initializes firebase connection

func (*Repository) Stop

func (r *Repository) Stop() error

Stop does nothing

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

func (rr *RoundRepository) SetTeamState(round *switchers.Round, index int, state string) error

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

Jump to

Keyboard shortcuts

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