Documentation ¶
Index ¶
- Constants
- func Errorf(status int, format string, a ...interface{}) error
- func GetCodeFromError(err error) (int, bool)
- type ApiController
- type Class
- type ClassRequestBody
- type HttpStatusError
- type Quiz
- type QuizInfos
- type QuizQuestion
- type QuizQuestionAnswer
- type QuizSession
- type QuizSessionDetail
- type Role
- type Session
- type SessionAnswerRequestBody
- type SessionResult
- type User
- type UserSession
Constants ¶
View Source
const ( NoRole Role = "NO_ROLE" Admin = "ADMIN" Teacher = "TEACHER" Student = "STUDENT" Machine = "MACHINE" )
Variables ¶
This section is empty.
Functions ¶
func GetCodeFromError ¶
Types ¶
type ApiController ¶
type ApiController struct {
// contains filtered or unexported fields
}
func NewApiController ¶
func NewApiController( authService *domain.AuthService, classService *domain.ClassService, quizService *domain.QuizService, userService *domain.UserService, healthService *domain.HealthService, maintenanceService *domain.MaintenanceService) ApiController
func (*ApiController) Serve ¶
func (c *ApiController) Serve()
func (*ApiController) SetReady ¶
func (c *ApiController) SetReady()
type ClassRequestBody ¶
type ClassRequestBody struct {
Name string `json:"name" binding:"required"`
}
type HttpStatusError ¶
type HttpStatusError struct {
// contains filtered or unexported fields
}
func (*HttpStatusError) Error ¶
func (e *HttpStatusError) Error() string
func (*HttpStatusError) HTTPStatus ¶
func (e *HttpStatusError) HTTPStatus() int
type Quiz ¶
type Quiz struct { Sha1 string `json:"sha1"` Filename string `json:"filename"` Name string `json:"name"` Version int `json:"version"` CreatedAt string `json:"createdAt"` Duration int `json:"duration"` Active bool `json:"active"` Questions []QuizQuestion `json:"questions,omitempty"` Classes []Class `json:"classes,omitempty"` }
type QuizQuestion ¶
type QuizQuestionAnswer ¶
type QuizSession ¶
type QuizSession struct { QuizSha1 string `json:"quizSha1"` Name string `json:"name"` Duration int `json:"duration"` Filename string `json:"filename,omitempty"` Version int `json:"version,omitempty"` CreatedAt string `json:"createdAt,omitempty"` SessionId *uuid.UUID `json:"sessionId,omitempty"` UserId string `json:"userId,omitempty"` UserName string `json:"userName,omitempty"` RemainingSec int `json:"remainingSec,omitempty"` Result *SessionResult `json:"result,omitempty"` UserSessions []*UserSession `json:"userSessions,omitempty"` }
type QuizSessionDetail ¶
type QuizSessionDetail struct { SessionId uuid.UUID `json:"sessionId"` UserId string `json:"userId"` RemainingSec int `json:"remainingSec"` Result *SessionResult `json:"result,omitempty"` QuizSha1 string `json:"quizSha1"` Name string `json:"name"` QuizDuration int `json:"quizDuration"` Questions []QuizQuestion `json:"questions"` }
type Session ¶
type Session struct { Id uuid.UUID `json:"id"` QuizSha1 string `json:"quizSha1,omitempty"` QuizName string `json:"quizName,omitempty"` QuizActive bool `json:"quizActive,omitempty"` UserId string `json:"userId,omitempty"` UserName string `json:"userName,omitempty"` RemainingSec int `json:"remainingSec,omitempty"` Result *SessionResult `json:"result,omitempty"` }
type SessionResult ¶
type UserSession ¶
Click to show internal directories.
Click to hide internal directories.