Documentation ¶
Index ¶
- func AddToQueue(job JudgeJob)
- func JudgeCase(batchNum uint64, caseNum uint64, session *shared.JudgeSession, ...) pb.TestCaseResult
- func StartGrader(session *GradeSession)
- func StartQueueWorker(num int)
- func TestSolution(req *pb.TestSolutionRequest, res chan shared.JudgeStatus, cancelled *bool)
- type CaseReturn
- type DoubleGrader
- type EndTrimGrader
- type FieldGrader
- type GradeSession
- type Grader
- type JudgeJob
- type StrictGrader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JudgeCase ¶
func JudgeCase(batchNum uint64, caseNum uint64, session *shared.JudgeSession, res chan shared.JudgeStatus, batchCase *cache.CachedTestDataCase) pb.TestCaseResult
func StartGrader ¶
func StartGrader(session *GradeSession)
func TestSolution ¶
func TestSolution(req *pb.TestSolutionRequest, res chan shared.JudgeStatus, cancelled *bool)
Types ¶
type CaseReturn ¶
type DoubleGrader ¶
type DoubleGrader struct{}
func (DoubleGrader) CompareStream ¶
func (grader DoubleGrader) CompareStream(session *GradeSession, expectedAnswerFile *os.File, done chan CaseReturn)
type EndTrimGrader ¶
type EndTrimGrader struct{}
func (EndTrimGrader) CompareStream ¶
func (grader EndTrimGrader) CompareStream(session *GradeSession, expectedAnswerFile *os.File, done chan CaseReturn)
type FieldGrader ¶
type FieldGrader struct{}
func (FieldGrader) CompareStream ¶
func (grader FieldGrader) CompareStream(session *GradeSession, expectedAnswerFile *os.File, done chan CaseReturn)
type GradeSession ¶
type GradeSession struct { JudgingSession *shared.JudgeSession // case information Problem *pb.Problem Solution *pb.Solution CurrentCase *cache.CachedTestDataCase BatchNum uint64 CaseNum uint64 // streams during judging OutputStream *os.File ErrorStream *os.File InputStream *os.File Stderr string // error dumped here StreamResult chan pb.TestCaseResult // return result to runner StreamDone chan CaseReturn // end batch case with verdict DoneSent bool // whether or not the done channel was used // for forkexec Command *exec.Cmd ExecFile uintptr // seccomp & ptrace SandboxWithSeccomp bool SeccompProfile util.SandboxProfile // sandbox session RunnerSession sandbox.RunnerSession RunnerResult sandbox.RunnerSessionResult }
func (*GradeSession) CloseStreams ¶
func (session *GradeSession) CloseStreams()
func (*GradeSession) InitIOFiles ¶
func (session *GradeSession) InitIOFiles()
func (*GradeSession) StartJudging ¶
func (session *GradeSession) StartJudging()
func (*GradeSession) WaitVerdict ¶
func (session *GradeSession) WaitVerdict()
type Grader ¶
type Grader interface { // must wait on session.StreamProcEnd and send output to done CompareStream(session *GradeSession, expectedAnswer *os.File, done chan CaseReturn) }
type JudgeJob ¶
type JudgeJob struct { Req *pb.TestSolutionRequest Res chan shared.JudgeStatus Cancelled *bool }
type StrictGrader ¶
type StrictGrader struct{}
func (StrictGrader) CompareStream ¶
func (grader StrictGrader) CompareStream(session *GradeSession, expectedAnswerFile *os.File, done chan CaseReturn)
Click to show internal directories.
Click to hide internal directories.