Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
ID string `gorm:"primaryKey" json:"id"`
CreatedAt time.Time
UpdatedAt time.Time
SubmissionID string `gorm:"index" json:"submission_id"`
UserID string `gorm:"index" json:"user_id"`
User User `gorm:"foreignKey:UserID" json:"user"`
DockerID string `gorm:"docker_id" json:"docker_id"`
Image string `json:"image"`
Status Status `json:"status"`
ExitCode int `json:"exit_code"`
StartedAt time.Time `json:"started_at"`
FinishedAt time.Time `json:"finished_at"`
LogFilePath string `json:"log_file_path"`
}
type ContestScoreHistory ¶
type JSONMap ¶
type JSONMap map[string]interface{}
JSONMap is a helper type for storing JSON data in the database.
type Submission ¶
type Submission struct {
ID string `gorm:"primaryKey" json:"id"`
CreatedAt time.Time
UpdatedAt time.Time
ProblemID string `gorm:"index" json:"problem_id"`
UserID string `gorm:"index" json:"user_id"`
User User `json:"user"`
Status Status `gorm:"index" json:"status"`
CurrentStep int `json:"current_step"` // index of the current workflow step
Cluster string `json:"cluster"`
Node string `json:"node"`
AllocatedCores string `json:"allocated_cores"` // e.g., "2,3,4"
Score int `json:"score"`
Performance float64 `json:"performance"`
Info JSONMap `gorm:"type:text" json:"info"`
IsValid bool `json:"is_valid"`
Containers []Container `gorm:"foreignKey:SubmissionID;constraint:OnDelete:CASCADE" json:"containers"`
}
type User ¶
type User struct {
ID string `gorm:"primaryKey" json:"id"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
GitLabID *string `gorm:"uniqueIndex" json:"-"`
Username string `gorm:"uniqueIndex" json:"username"`
PasswordHash string `json:"-"`
Nickname string `json:"nickname"`
Signature string `json:"signature"`
AvatarURL string `json:"avatar_url"`
BannedUntil *time.Time `json:"banned_until"`
BanReason string `json:"ban_reason"`
DisableRank bool `gorm:"default:false" json:"disable_rank"`
Tags string `gorm:"type:text" json:"tags"` // Comma-separated tags
}
type UserProblemBestScore ¶
type UserProblemBestScore struct {
ID uint `gorm:"primaryKey"`
UserID string `gorm:"uniqueIndex:idx_user_problem"`
ContestID string `gorm:"uniqueIndex:idx_user_problem"`
ProblemID string `gorm:"uniqueIndex:idx_user_problem"`
Score int
Performance float64
SubmissionID string
SubmissionCount int
LastScoreTime time.Time
}
Click to show internal directories.
Click to hide internal directories.