Documentation ¶
Index ¶
- type AuthService
- type Creators
- type MatchService
- func (service MatchService) CreateMatch(player models.Player, specs models.Specs) (quiz models.Game, err error)
- func (service MatchService) FindActiveMatchesForPlayer(playerId string) (matches []models.Game, err error)
- func (service MatchService) UpdateMatchTags(match models.Game, tag string) (bool, error)
- type PermissionService
- type PlayerService
- type QuestionService
- type Service
- func (service Service) DeletePlayerLiveSession(playerId string) (res models.WebsocketMessage, targets map[string]bool, err error)
- func (service Service) FindMatchFull(matchId string) (match models.Game, teams []models.Team, subscribers []models.Subscriber, ...)
- func (service Service) GenerateBeginGameResponse(player models.Player) (res models.LoginResponse, err error)
- func (service Service) GenerateCreateGameResponse(quizmaster models.Player, specs models.Specs) (response models.GameResponse, err error)
- func (service Service) GenerateEnterGameResponse(request models.Request) (response models.GameResponse, err error)
- func (service Service) GenerateFinishGameResponse(request models.Request) (response models.Snapshot, err error)
- func (service Service) GenerateFullMatchResponse(quizId string) (response models.Snapshot, err error)
- func (service Service) GenerateGameResponse(request models.Request) (response models.Snapshot, err error)
- func (service Service) GenerateNextQuestionResponse(request models.Request) (response models.Snapshot, err error)
- func (service Service) GeneratePassQuestionResponse(request models.Request) (response models.Snapshot, err error)
- func (service Service) GenerateQuestionAnswerResponse(request models.Request) (response models.Snapshot, err error)
- func (service Service) GenerateQuestionHintResponse(request models.Request) (response models.Snapshot, err error)
- func (service Service) GenerateScoreResponse(request models.Request) (response models.ScoreResponse, err error)
- func (service Service) GenerateStartGameResponse(request models.Request) (response models.Snapshot, err error)
- func (service Service) GenerateWatchGameResponse(request models.Request) (response models.GameResponse, err error)
- type SnapshotService
- func (service SnapshotService) CreateSnapshot(snapshot models.Snapshot) (err error)
- func (service SnapshotService) FindSnapshotsForMatch(matchId string) (snapshots []models.Snapshot, err error)
- func (service SnapshotService) FindSnapshotsForQuestion(quizId string, questionId string, eventType string) (snapshots []models.Snapshot, err error)
- func (service SnapshotService) InitialSnapshot(quizId string, teams []models.Team) (response models.Snapshot, err error)
- func (service SnapshotService) SnapshotAnswer(snapshot models.Snapshot, roster []models.TeamRoster, answer models.Answer, ...) (response models.Snapshot, err error)
- func (service SnapshotService) SnapshotDrop(snapshot models.Snapshot, roster []models.TeamRoster) (response models.Snapshot, err error)
- func (service SnapshotService) SnapshotFinish(snapshot models.Snapshot, roster []models.TeamRoster) (response models.Snapshot, err error)
- func (service SnapshotService) SnapshotHint(snapshot models.Snapshot, roster []models.TeamRoster, hint []string) (response models.Snapshot, err error)
- func (service SnapshotService) SnapshotJoin(snapshot models.Snapshot, roster []models.TeamRoster) (response models.Snapshot, err error)
- func (service SnapshotService) SnapshotNext(snapshot models.Snapshot, roster []models.TeamRoster, question models.Question, ...) (response models.Snapshot, err error)
- func (service SnapshotService) SnapshotPass(snapshot models.Snapshot, roster []models.TeamRoster, teamsTurn string, ...) (response models.Snapshot, err error)
- func (service SnapshotService) SnapshotStart(snapshot models.Snapshot, roster []models.TeamRoster, question models.Question, ...) (response models.Snapshot, err error)
- type SubscriberService
- func (service SubscriberService) FindOrCreateSubscriber(tag string, audience models.Player, role actions.Role) (subscriber models.Subscriber, err error)
- func (service SubscriberService) FindPlayerIdsFromSubscribers(subscribers []models.Subscriber) (playerIds []string)
- func (service SubscriberService) FindSubscribers(tag string, role actions.Role) (subscribers []models.Subscriber, err error)
- func (service SubscriberService) FindSubscribersForTags(tags []string) (subscribers []models.Subscriber, err error)
- func (service SubscriberService) FindSubscriptionsForPlayerId(playerId string) (subscribers []models.Subscriber, err error)
- func (service SubscriberService) QuizResponse(action string, quizId string, response models.Snapshot) (res models.WebsocketMessage, targets map[string]bool)
- func (service SubscriberService) SelfResponse(playerId string, action actions.Action, response interface{}) (res models.WebsocketMessage, targets map[string]bool)
- func (service SubscriberService) SubscribeAndRespond(match models.Game, player models.Player, snapshot models.Snapshot, ...) (response models.GameResponse, err error)
- type TargetService
- type TeamService
- func (service TeamService) CreateTeams(quiz models.Game) (teams []models.Team, err error)
- func (service TeamService) FindAndFillTeamVacancy(match models.Game, teams []models.Team, player models.Player) (teamId string, err error)
- func (service TeamService) FindTeamIdsFromTeams(teams []models.Team) (teamIds []string)
- func (service TeamService) FindTeams(quizId string) (teams []models.Team, err error)
- func (service TeamService) FindVacantTeamId(teams []models.Team, subscribers []models.Subscriber, playersCount int) (teamId string)
- type Validator
- func (validator Validator) ValidateBeginRequest(request models.Request) (err error)
- func (validator Validator) ValidateCreateQuizRequest(request models.Request) (err error)
- func (validator Validator) ValidateRefeshQuizRequest(request models.Request) (err error)
- func (validator Validator) ValidateRequest(request models.Request) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService struct{}
func (AuthService) AccessTokenClaims ¶
func (service AuthService) AccessTokenClaims(user models.Player) (claims jwt.MapClaims)
Generates claims to sign with the access token.
func (AuthService) GenerateTokens ¶
func (service AuthService) GenerateTokens(user models.Player) (models.AuthenticationResponse, error)
func (AuthService) RefreshTokenClaims ¶
func (service AuthService) RefreshTokenClaims(user models.Player) (claims jwt.MapClaims)
Generates claims to sign with the refresh token.
type Creators ¶
type Creators struct { InstanceCreator models.Creator MessageCreator models.WebsocketMessageCreator ErrorCreator errors.ErrorMessageCreator }
type MatchService ¶
type MatchService struct { Crud db.MatchCrud SubscriberService SubscriberService }
func (MatchService) CreateMatch ¶
func (MatchService) FindActiveMatchesForPlayer ¶
func (service MatchService) FindActiveMatchesForPlayer(playerId string) (matches []models.Game, err error)
func (MatchService) UpdateMatchTags ¶
type PermissionService ¶
type PermissionService struct {
Crud db.PermissionCrud
}
func (PermissionService) HasPermissions ¶
func (servie PermissionService) HasPermissions(playerId string) bool
type PlayerService ¶
type PlayerService struct {
Crud db.PlayerCrud
}
func (PlayerService) FindOrCreatePlayer ¶
func (PlayerService) FindPlayerByEmail ¶
func (service PlayerService) FindPlayerByEmail(email string) (player models.Player, err error)
func (PlayerService) FindPlayers ¶
func (service PlayerService) FindPlayers(playerIds []string) (players []models.Player, err error)
type QuestionService ¶
type QuestionService struct {
Crud db.QuestionCrud
}
func (QuestionService) AddQuestion ¶
func (service QuestionService) AddQuestion(tag string, newQuestions []models.NewQuestion) (err error)
func (QuestionService) FindQuestionForMatch ¶
type Service ¶
type Service struct { AuthService AuthService PermissionService PermissionService MatchService MatchService SubscriberService SubscriberService PlayerService PlayerService TeamService TeamService QuestionService QuestionService SnapshotService SnapshotService Validator Validator TargetService TargetService Creators Creators }
func (Service) DeletePlayerLiveSession ¶
func (Service) FindMatchFull ¶
func (Service) GenerateBeginGameResponse ¶
func (Service) GenerateCreateGameResponse ¶
func (Service) GenerateEnterGameResponse ¶
func (Service) GenerateFinishGameResponse ¶
func (Service) GenerateFullMatchResponse ¶
func (Service) GenerateGameResponse ¶
func (Service) GenerateNextQuestionResponse ¶
func (Service) GeneratePassQuestionResponse ¶
func (Service) GenerateQuestionAnswerResponse ¶
func (Service) GenerateQuestionHintResponse ¶
func (Service) GenerateScoreResponse ¶
func (Service) GenerateStartGameResponse ¶
func (Service) GenerateWatchGameResponse ¶
type SnapshotService ¶
type SnapshotService struct {
Crud db.SnapshotCrud
}
func (SnapshotService) CreateSnapshot ¶
func (service SnapshotService) CreateSnapshot(snapshot models.Snapshot) (err error)
func (SnapshotService) FindSnapshotsForMatch ¶
func (service SnapshotService) FindSnapshotsForMatch(matchId string) (snapshots []models.Snapshot, err error)
func (SnapshotService) FindSnapshotsForQuestion ¶
func (SnapshotService) InitialSnapshot ¶
func (SnapshotService) SnapshotAnswer ¶
func (SnapshotService) SnapshotDrop ¶
func (service SnapshotService) SnapshotDrop(snapshot models.Snapshot, roster []models.TeamRoster) (response models.Snapshot, err error)
func (SnapshotService) SnapshotFinish ¶
func (service SnapshotService) SnapshotFinish(snapshot models.Snapshot, roster []models.TeamRoster) (response models.Snapshot, err error)
func (SnapshotService) SnapshotHint ¶
func (service SnapshotService) SnapshotHint(snapshot models.Snapshot, roster []models.TeamRoster, hint []string) (response models.Snapshot, err error)
func (SnapshotService) SnapshotJoin ¶
func (service SnapshotService) SnapshotJoin(snapshot models.Snapshot, roster []models.TeamRoster) (response models.Snapshot, err error)
func (SnapshotService) SnapshotNext ¶
func (SnapshotService) SnapshotPass ¶
func (SnapshotService) SnapshotStart ¶
type SubscriberService ¶
type SubscriberService struct { Crud db.SubscriberCrud TargetService TargetService Creators Creators }
func (SubscriberService) FindOrCreateSubscriber ¶
func (service SubscriberService) FindOrCreateSubscriber(tag string, audience models.Player, role actions.Role) (subscriber models.Subscriber, err error)
func (SubscriberService) FindPlayerIdsFromSubscribers ¶
func (service SubscriberService) FindPlayerIdsFromSubscribers(subscribers []models.Subscriber) (playerIds []string)
func (SubscriberService) FindSubscribers ¶
func (service SubscriberService) FindSubscribers(tag string, role actions.Role) (subscribers []models.Subscriber, err error)
func (SubscriberService) FindSubscribersForTags ¶
func (service SubscriberService) FindSubscribersForTags(tags []string) (subscribers []models.Subscriber, err error)
func (SubscriberService) FindSubscriptionsForPlayerId ¶
func (service SubscriberService) FindSubscriptionsForPlayerId(playerId string) (subscribers []models.Subscriber, err error)
func (SubscriberService) QuizResponse ¶
func (service SubscriberService) QuizResponse(action string, quizId string, response models.Snapshot) (res models.WebsocketMessage, targets map[string]bool)
func (SubscriberService) SelfResponse ¶
func (service SubscriberService) SelfResponse(playerId string, action actions.Action, response interface{}) (res models.WebsocketMessage, targets map[string]bool)
func (SubscriberService) SubscribeAndRespond ¶
type TargetService ¶
type TargetService struct{}
func (TargetService) TargetQuiz ¶
func (target TargetService) TargetQuiz(quizId string, subscribers []models.Subscriber) (targets map[string]bool)
func (TargetService) TargetSelf ¶
func (target TargetService) TargetSelf(playerId string) (targets map[string]bool)
type TeamService ¶
type TeamService struct { Crud db.TeamCrud SubscriberService SubscriberService }
func (TeamService) CreateTeams ¶
func (TeamService) FindAndFillTeamVacancy ¶
func (TeamService) FindTeamIdsFromTeams ¶
func (service TeamService) FindTeamIdsFromTeams(teams []models.Team) (teamIds []string)
func (TeamService) FindTeams ¶
func (service TeamService) FindTeams(quizId string) (teams []models.Team, err error)
func (TeamService) FindVacantTeamId ¶
func (service TeamService) FindVacantTeamId(teams []models.Team, subscribers []models.Subscriber, playersCount int) (teamId string)
type Validator ¶
type Validator struct{}
func (Validator) ValidateBeginRequest ¶
func (Validator) ValidateCreateQuizRequest ¶
func (Validator) ValidateRefeshQuizRequest ¶
Click to show internal directories.
Click to hide internal directories.