Documentation ¶
Overview ¶
problems contains database storage actions for problems and test data.
Index ¶
- Constants
- Variables
- func CreateProblem(ctx context.Context, p *models.Problem) error
- func GetStatementFile(ctx context.Context, problemShort string, path string) (*models.ProblemStatementFile, error)
- func List(ctx context.Context, args ListArgs, filter ListFilter) (models.ProblemList, error)
- func UpdateProblem(ctx context.Context, problem *models.Problem) error
- type ListArgs
- type ListFilter
- type ProblemFilter
- type StmtOpt
- type TestOpt
Constants ¶
View Source
const ( TestsNone TestOpt = iota // Only load sample test groups. TestsSamples // Load only the test data structure. TestsGroups // Load only the sample test groups and the test data structure . TestsSamplesAndGroups // Load test data and validators. TestsAll StmtNone StmtOpt = iota // Include only titles. StmtTitles // Include titles and HTML statement. StmtAll )
Variables ¶
View Source
var ErrDuplicateProblemName = errors.New("duplicate problem name")
ErrDuplicateProblemName is returned when the inserted problem shortname already exists in the database.
Functions ¶
func CreateProblem ¶
CreateProblem persists a new problem into the database.
func GetStatementFile ¶
func List ¶
func List(ctx context.Context, args ListArgs, filter ListFilter) (models.ProblemList, error)
Types ¶
type ListFilter ¶
type ListFilter struct { ShortName string Problems *ProblemFilter ContestID int32 }
A ListFilter filters the problems to search for. Only one filter may be set.
func Problems ¶
func Problems(problemIDs ...int32) ListFilter
type ProblemFilter ¶
type ProblemFilter struct {
ProblemID []int32
}
Click to show internal directories.
Click to hide internal directories.