Documentation ¶
Overview ¶
submissions contains database storage actions for submissions and submission runs.
Index ¶
- func CreateGroupRun(ctx context.Context, run *models.TestGroupRun) error
- func CreateRun(ctx context.Context, run *models.SubmissionRun) error
- func CreateRunTx(ctx context.Context, run *models.SubmissionRun, tx *sqlx.Tx) error
- func CreateSubmission(ctx context.Context, sub *models.Submission, problemVersion int32) error
- func CreateSubmissionTx(ctx context.Context, tx *sqlx.Tx, sub *models.Submission) error
- func ListRuns(ctx context.Context, args RunListArgs, filterArgs RunListFilter) ([]*models.SubmissionRun, error)
- func UpdateRun(ctx context.Context, run *models.SubmissionRun, args UpdateRunArgs) error
- type ListArgs
- type ListFilter
- type ProblemFilter
- type RunField
- type RunListArgs
- type RunListFilter
- type SubmissionFilter
- type SubmissionList
- type UpdateRunArgs
- type UserFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateGroupRun ¶
func CreateGroupRun(ctx context.Context, run *models.TestGroupRun) error
func CreateRun ¶
func CreateRun(ctx context.Context, run *models.SubmissionRun) error
CreateRun creates a new run for a submission.
func CreateRunTx ¶
CreateRun creates a new submission run in a transaction.
func CreateSubmission ¶
CreateSubmission persists a new submission.
func CreateSubmissionTx ¶
CreateSubmissionTx persists a new submission within a transaction.
func ListRuns ¶
func ListRuns(ctx context.Context, args RunListArgs, filterArgs RunListFilter) ([]*models.SubmissionRun, error)
ListRuns searches for a list of runs.
func UpdateRun ¶
func UpdateRun(ctx context.Context, run *models.SubmissionRun, args UpdateRunArgs) error
UpdateRun updates the given submission run in the database.
Types ¶
type ListArgs ¶
type ListArgs struct { // Whether to include submission files in the query. WithFiles bool // Whether to include the current run in the query. WithRun bool WithGroupRuns bool WithAccounts bool }
A ListArgs controls what data to include in submissions.
type ListFilter ¶
type ListFilter struct { Submissions *SubmissionFilter Users *UserFilter Problems *ProblemFilter OnlyAvailable bool }
A ListFilter controls what submissions to search for.
type ProblemFilter ¶
type ProblemFilter struct {
ProblemIDs []int32
}
type RunListArgs ¶
type RunListArgs struct { }
type RunListFilter ¶
type RunListFilter struct { // Whether only unprocessed runs should be included. OnlyUnjudged bool RunID []int32 }
A RunListFilter controls what runs to search for.
type SubmissionFilter ¶
type SubmissionFilter struct {
SubmissionIDs []int32
}
type SubmissionList ¶
type SubmissionList []*models.Submission
A SubmissionList is a slice of Submissions.
func ListSubmissions ¶
func ListSubmissions(ctx context.Context, args ListArgs, filterArgs ListFilter) (SubmissionList, error)
ListSubmissions searches for a list of submissions.
func (SubmissionList) ProblemIDs ¶
func (lists SubmissionList) ProblemIDs() []int32
type UpdateRunArgs ¶
type UpdateRunArgs struct { // The fields of a SubmissionRun to update. Fields []RunField }
An UpdateRunArgs controls what to update in a run.
type UserFilter ¶
type UserFilter struct {
UserIDs []int32
}