Documentation ¶
Index ¶
- Variables
- type PlaySessionSVC
- type PlaySessionSvc
- func (ps *PlaySessionSvc) AddTeamToPS(ctx context.Context, code uint, t *models.Team) (err error)
- func (ps *PlaySessionSvc) AddUserToPS(ctx context.Context, code uint) (err error)
- func (ps *PlaySessionSvc) AddUserToTeam(ctx context.Context, code uint, teamName string, email string) (err error)
- func (ps *PlaySessionSvc) DecrementPSQuestion(ctx context.Context, code uint) (err error)
- func (ps *PlaySessionSvc) EndPlaySession(ctx context.Context, code uint) (err error)
- func (ps *PlaySessionSvc) GetPS(ctx context.Context, code uint) (s *models.PlaySession, err error)
- func (ps *PlaySessionSvc) IncrementPSQuestion(ctx context.Context, code uint) (err error)
- func (ps *PlaySessionSvc) InitNewPS(ctx context.Context, quizID uint) (s *models.PlaySession, err error)
- func (ps *PlaySessionSvc) RevealPSCurrentAnswer(ctx context.Context, code uint) (err error)
- func (ps *PlaySessionSvc) StartPS(ctx context.Context, code uint) (err error)
- func (ps *PlaySessionSvc) UpdateTeamPoints(ctx context.Context, code uint, points int, teamName string) (err error)
- func (ps *PlaySessionSvc) UserContextKey() contextKey
- type QHub
- func (hub *QHub) AddQuestion(ctx context.Context, q *models.Question) (err error)
- func (hub *QHub) CreateQuiz(ctx context.Context, name string, tags []string) (qz *models.Quiz, err error)
- func (hub *QHub) DeleteQuestion(ctx context.Context, id, quizID uint) (err error)
- func (hub *QHub) DeleteQuiz(ctx context.Context, id uint) (err error)
- func (hub *QHub) GetMyQuizzes(ctx context.Context) (qqz []*models.Quiz, err error)
- func (hub *QHub) GetPublicQuizzes(ctx context.Context) (qqz []*models.Quiz, err error)
- func (hub *QHub) GetQuestion(ctx context.Context, id uint, quizID uint) (q *models.Question, err error)
- func (hub *QHub) GetQuestions(ctx context.Context, quizID uint) (qq []*models.Question, err error)
- func (hub *QHub) GetQuiz(ctx context.Context, id uint) (qz *models.Quiz, err error)
- func (hub *QHub) LogIn(ctx context.Context, user *models.User) (err error)
- func (hub *QHub) ToggleQuizPrivacy(ctx context.Context, id uint) (err error)
- func (hub *QHub) UpdateQuestion(ctx context.Context, id, quizID uint, q *models.Question) (err error)
- func (hub *QHub) UserContextKey() contextKey
- type QServer
- func (s *QServer) AddPSTeamPoints() http.HandlerFunc
- func (s *QServer) AddQuestion() http.HandlerFunc
- func (s *QServer) AddTeam() http.HandlerFunc
- func (s *QServer) AddUserToTeam() http.HandlerFunc
- func (s QServer) AuthMW(next http.Handler) http.Handler
- func (s *QServer) BroadcastChatMessage() http.HandlerFunc
- func (s *QServer) CorsMW() http.Handler
- func (s *QServer) CreatePS() http.HandlerFunc
- func (s *QServer) CreateQuiz() http.HandlerFunc
- func (s *QServer) DecrementPSQuestion() http.HandlerFunc
- func (s *QServer) DeleteQuestion() http.HandlerFunc
- func (s *QServer) DeleteQuiz() http.HandlerFunc
- func (s *QServer) EndPS() http.HandlerFunc
- func (s *QServer) GetMyQuizzes() http.HandlerFunc
- func (s *QServer) GetPS() http.HandlerFunc
- func (s *QServer) GetQuestion() http.HandlerFunc
- func (s *QServer) GetQuiz() http.HandlerFunc
- func (s *QServer) GetQuizQuestions() http.HandlerFunc
- func (s *QServer) GetQuizzes() http.HandlerFunc
- func (s *QServer) Health() http.HandlerFunc
- func (s *QServer) IncrementPSQuestion() http.HandlerFunc
- func (s *QServer) JoinPS() http.HandlerFunc
- func (s *QServer) LoggingMW(next http.Handler) http.Handler
- func (s QServer) OptionalAuthMW(next http.Handler) http.Handler
- func (s *QServer) RevealPSCurrentAnswer() http.HandlerFunc
- func (s *QServer) Shutdown(ctx context.Context) error
- func (s *QServer) Start() error
- func (s *QServer) StartPS() http.HandlerFunc
- func (s *QServer) ToggleQuizPrivacy() http.HandlerFunc
- func (s *QServer) UpdateQuestion() http.HandlerFunc
- func (s *QServer) UploadFile() http.HandlerFunc
- func (s *QServer) UserContextKey() contextKey
- func (s *QServer) WebSocketPS() http.HandlerFunc
- type QuizHub
Constants ¶
This section is empty.
Variables ¶
View Source
var NotPermittedError = errors.New("User is not permitted for the following action")
View Source
var UserNotFound = errors.New("User not found")
Functions ¶
This section is empty.
Types ¶
type PlaySessionSVC ¶
type PlaySessionSVC interface { InitNewPS(ctx context.Context, quizID uint) (s *models.PlaySession, err error) StartPS(ctx context.Context, code uint) (err error) AddUserToPS(ctx context.Context, code uint) (err error) AddUserToTeam(ctx context.Context, code uint, teamName string, email string) (err error) AddTeamToPS(ctx context.Context, code uint, team *models.Team) (err error) IncrementPSQuestion(ctx context.Context, code uint) (err error) DecrementPSQuestion(ctx context.Context, code uint) (err error) RevealPSCurrentAnswer(ctx context.Context, code uint) (err error) GetPS(ctx context.Context, code uint) (s *models.PlaySession, err error) UpdateTeamPoints(ctx context.Context, code uint, points int, teamName string) (err error) EndPlaySession(ctx context.Context, code uint) (err error) }
type PlaySessionSvc ¶
type PlaySessionSvc struct {
// contains filtered or unexported fields
}
func NewPlaySessionSvc ¶
func NewPlaySessionSvc(db models.QuizStore) *PlaySessionSvc
func (*PlaySessionSvc) AddTeamToPS ¶
func (*PlaySessionSvc) AddUserToPS ¶
func (ps *PlaySessionSvc) AddUserToPS(ctx context.Context, code uint) (err error)
func (*PlaySessionSvc) AddUserToTeam ¶
func (*PlaySessionSvc) DecrementPSQuestion ¶
func (ps *PlaySessionSvc) DecrementPSQuestion(ctx context.Context, code uint) (err error)
func (*PlaySessionSvc) EndPlaySession ¶
func (ps *PlaySessionSvc) EndPlaySession(ctx context.Context, code uint) (err error)
func (*PlaySessionSvc) GetPS ¶
func (ps *PlaySessionSvc) GetPS(ctx context.Context, code uint) (s *models.PlaySession, err error)
func (*PlaySessionSvc) IncrementPSQuestion ¶
func (ps *PlaySessionSvc) IncrementPSQuestion(ctx context.Context, code uint) (err error)
func (*PlaySessionSvc) InitNewPS ¶
func (ps *PlaySessionSvc) InitNewPS(ctx context.Context, quizID uint) (s *models.PlaySession, err error)
func (*PlaySessionSvc) RevealPSCurrentAnswer ¶
func (ps *PlaySessionSvc) RevealPSCurrentAnswer(ctx context.Context, code uint) (err error)
func (*PlaySessionSvc) StartPS ¶
func (ps *PlaySessionSvc) StartPS(ctx context.Context, code uint) (err error)
func (*PlaySessionSvc) UpdateTeamPoints ¶
func (*PlaySessionSvc) UserContextKey ¶
func (ps *PlaySessionSvc) UserContextKey() contextKey
type QHub ¶
type QHub struct { *PlaySessionSvc // contains filtered or unexported fields }
func (*QHub) AddQuestion ¶
func (*QHub) CreateQuiz ¶
func (*QHub) DeleteQuestion ¶
func (*QHub) GetMyQuizzes ¶
func (*QHub) GetPublicQuizzes ¶
func (*QHub) GetQuestion ¶
func (*QHub) GetQuestions ¶
func (*QHub) ToggleQuizPrivacy ¶
func (*QHub) UpdateQuestion ¶
func (*QHub) UserContextKey ¶
func (hub *QHub) UserContextKey() contextKey
type QServer ¶
type QServer struct {
// contains filtered or unexported fields
}
func NewQServer ¶
func (*QServer) AddPSTeamPoints ¶
func (s *QServer) AddPSTeamPoints() http.HandlerFunc
func (*QServer) AddQuestion ¶
func (s *QServer) AddQuestion() http.HandlerFunc
func (*QServer) AddTeam ¶
func (s *QServer) AddTeam() http.HandlerFunc
func (*QServer) AddUserToTeam ¶
func (s *QServer) AddUserToTeam() http.HandlerFunc
func (*QServer) BroadcastChatMessage ¶
func (s *QServer) BroadcastChatMessage() http.HandlerFunc
func (*QServer) CreatePS ¶
func (s *QServer) CreatePS() http.HandlerFunc
func (*QServer) CreateQuiz ¶
func (s *QServer) CreateQuiz() http.HandlerFunc
func (*QServer) DecrementPSQuestion ¶
func (s *QServer) DecrementPSQuestion() http.HandlerFunc
func (*QServer) DeleteQuestion ¶
func (s *QServer) DeleteQuestion() http.HandlerFunc
func (*QServer) DeleteQuiz ¶
func (s *QServer) DeleteQuiz() http.HandlerFunc
func (*QServer) EndPS ¶
func (s *QServer) EndPS() http.HandlerFunc
func (*QServer) GetMyQuizzes ¶
func (s *QServer) GetMyQuizzes() http.HandlerFunc
func (*QServer) GetPS ¶
func (s *QServer) GetPS() http.HandlerFunc
func (*QServer) GetQuestion ¶
func (s *QServer) GetQuestion() http.HandlerFunc
func (*QServer) GetQuiz ¶
func (s *QServer) GetQuiz() http.HandlerFunc
func (*QServer) GetQuizQuestions ¶
func (s *QServer) GetQuizQuestions() http.HandlerFunc
func (*QServer) GetQuizzes ¶
func (s *QServer) GetQuizzes() http.HandlerFunc
func (*QServer) Health ¶
func (s *QServer) Health() http.HandlerFunc
Health is the handler to check if the service is up
func (*QServer) IncrementPSQuestion ¶
func (s *QServer) IncrementPSQuestion() http.HandlerFunc
func (*QServer) JoinPS ¶
func (s *QServer) JoinPS() http.HandlerFunc
func (*QServer) RevealPSCurrentAnswer ¶
func (s *QServer) RevealPSCurrentAnswer() http.HandlerFunc
func (*QServer) StartPS ¶
func (s *QServer) StartPS() http.HandlerFunc
func (*QServer) ToggleQuizPrivacy ¶
func (s *QServer) ToggleQuizPrivacy() http.HandlerFunc
func (*QServer) UpdateQuestion ¶
func (s *QServer) UpdateQuestion() http.HandlerFunc
func (*QServer) UploadFile ¶
func (s *QServer) UploadFile() http.HandlerFunc
func (*QServer) UserContextKey ¶
func (s *QServer) UserContextKey() contextKey
func (*QServer) WebSocketPS ¶
func (s *QServer) WebSocketPS() http.HandlerFunc
type QuizHub ¶
type QuizHub interface { UserContextKey() contextKey LogIn(ctx context.Context, user *models.User) (err error) CreateQuiz(ctx context.Context, name string, tags []string) (qz *models.Quiz, err error) DeleteQuiz(ctx context.Context, id uint) (err error) GetQuiz(ctx context.Context, id uint) (qz *models.Quiz, err error) GetMyQuizzes(ctx context.Context) (qqz []*models.Quiz, err error) GetPublicQuizzes(ctx context.Context) (qqz []*models.Quiz, err error) AddQuestion(ctx context.Context, q *models.Question) (err error) UpdateQuestion(ctx context.Context, id, quizID uint, q *models.Question) (err error) DeleteQuestion(ctx context.Context, id, quizID uint) (err error) GetQuestions(ctx context.Context, quizID uint) (qq []*models.Question, err error) GetQuestion(ctx context.Context, id, quizID uint) (q *models.Question, err error) ToggleQuizPrivacy(ctx context.Context, id uint) (err error) PlaySessionSVC }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.