Documentation
¶
Index ¶
- Constants
- func ErrJwtTokenMissing() srvcerror.E
- func ErrSubmissionTooFrequent(delaySeconds int) srvcerror.E
- func ErrUnauthorizedUsernameMismatch() srvcerror.E
- type DetailedSubmView
- type Eval
- type MaxScore
- type PaginatedResponse
- type Pagination
- type PrLang
- type ScoreInfo
- type SubmHttpHandler
- func (h *SubmHttpHandler) GetFullSubm(w http.ResponseWriter, r *http.Request)
- func (h *SubmHttpHandler) GetMaxScorePerTask(w http.ResponseWriter, r *http.Request)
- func (h *SubmHttpHandler) GetSubmList(w http.ResponseWriter, r *http.Request)
- func (h *SubmHttpHandler) ListenToSubmListUpdates(w http.ResponseWriter, r *http.Request)
- func (h *SubmHttpHandler) PostSubm(w http.ResponseWriter, r *http.Request)
- func (h *SubmHttpHandler) ReevalSubms(w http.ResponseWriter, r *http.Request)
- func (h *SubmHttpHandler) RegisterRoutes(r *chi.Mux, jwtKey, adminAPIKey []byte, cookieSecure bool, ...)
- type SubmListEntry
- type Subtask
- type TaskPreview
- type TestGroup
Constants ¶
View Source
const ErrCodeSubmissionTooFrequent = "submission_too_frequent"
Variables ¶
This section is empty.
Functions ¶
func ErrJwtTokenMissing ¶
Types ¶
type DetailedSubmView ¶
type DetailedSubmView struct {
SubmUUID string `json:"subm_uuid"`
Content string `json:"content,omitempty"`
Username string `json:"username"`
CurrEval *Eval `json:"curr_eval"`
PrLang PrLang `json:"pr_lang"`
TaskID string `json:"task_id"`
TaskName string `json:"task_name"`
CreatedAt string `json:"created_at"`
}
type Eval ¶
type Eval struct {
EvalUUID string `json:"eval_uuid"`
SubmUUID string `json:"subm_uuid"`
EvalStage string `json:"eval_stage"`
ScoreUnit string `json:"score_unit"`
EvalError string `json:"eval_error"`
// ErrorMsg string `json:"error_msg"`
Subtasks []Subtask `json:"subtasks"`
TestGroups []TestGroup `json:"test_groups"`
Verdicts string `json:"verdicts"` // q,ac,wa,tle,mle,re,ig -> "QAWTMRI"
ScoreInfo ScoreInfo `json:"score_info"`
}
type PaginatedResponse ¶
type PaginatedResponse struct {
Page interface{} `json:"page"`
Pagination Pagination `json:"pagination"`
}
PaginatedResponse represents a paginated response with data and pagination metadata
type Pagination ¶
type Pagination struct {
Total int `json:"total"`
Offset int `json:"offset"`
Limit int `json:"limit"`
HasMore bool `json:"hasMore"`
}
Pagination represents pagination metadata
type ScoreInfo ¶
type ScoreInfo struct {
ScoreBar struct {
Green int `json:"green"`
Red int `json:"red"`
Gray int `json:"gray"`
Yellow int `json:"yellow"`
Purple int `json:"purple"`
} `json:"score_bar"`
ReceivedScore int `json:"received"`
PossibleScore int `json:"possible"`
MaxCpuMs int `json:"max_cpu_ms"` // milliseconds
MaxMemKiB int `json:"max_mem_kib"` // kibibytes
ExceededCpu bool `json:"exceeded_cpu"`
ExceededMem bool `json:"exceeded_mem"`
}
type SubmHttpHandler ¶
type SubmHttpHandler struct {
// contains filtered or unexported fields
}
func NewSubmHttpHandler ¶
func NewSubmHttpHandler( submSrvc submsrvc.SubmissionService, taskSrvc tasksrvc.TaskService, userSrvc usersrvc.UserService, ) *SubmHttpHandler
func (*SubmHttpHandler) GetFullSubm ¶
func (h *SubmHttpHandler) GetFullSubm(w http.ResponseWriter, r *http.Request)
func (*SubmHttpHandler) GetMaxScorePerTask ¶
func (h *SubmHttpHandler) GetMaxScorePerTask(w http.ResponseWriter, r *http.Request)
func (*SubmHttpHandler) GetSubmList ¶
func (h *SubmHttpHandler) GetSubmList(w http.ResponseWriter, r *http.Request)
func (*SubmHttpHandler) ListenToSubmListUpdates ¶
func (h *SubmHttpHandler) ListenToSubmListUpdates(w http.ResponseWriter, r *http.Request)
func (*SubmHttpHandler) PostSubm ¶
func (h *SubmHttpHandler) PostSubm(w http.ResponseWriter, r *http.Request)
func (*SubmHttpHandler) ReevalSubms ¶
func (h *SubmHttpHandler) ReevalSubms(w http.ResponseWriter, r *http.Request)
func (*SubmHttpHandler) RegisterRoutes ¶
func (h *SubmHttpHandler) RegisterRoutes(r *chi.Mux, jwtKey, adminAPIKey []byte, cookieSecure bool, pwdChangedAt auth.PasswordChangedAtLookup)
type SubmListEntry ¶
type SubmListEntry struct {
SubmUuid string `json:"subm_uuid"`
Username string `json:"username"`
TaskId string `json:"task_id"`
TaskName string `json:"task_name"`
PrLangId string `json:"pr_lang_id"`
PrLangName string `json:"pr_lang_name"`
ScoreInfo ScoreInfo `json:"score_info"`
Status string `json:"status"`
CreatedAt string `json:"created_at"`
}
type TaskPreview ¶
type TaskPreview struct {
ShortId string `json:"short_id"`
FullName string `json:"full_name"`
IllustrImg tasksrvc.IllustrationImage `json:"illustr_img"`
DifficultyRating int `json:"difficulty_rating"`
OriginOlympiad string `json:"origin_olympiad"`
OriginNotes []tasksrvc.OriginNote `json:"origin_notes"`
MdStatementStory string `json:"md_statement_story"`
}
Click to show internal directories.
Click to hide internal directories.