shared

package module
v0.0.0-...-a146e0a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2020 License: GPL-3.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

View Source
const (
	OUTCOME_AC   = "AC"   // answer correct
	OUTCOME_WA   = "WA"   // wrong answer
	OUTCOME_RTE  = "RTE"  // run time error
	OUTCOME_CE   = "CE"   // compile error
	OUTCOME_TLE  = "TLE"  // time limit exceeded
	OUTCOME_MLE  = "MLE"  // memory limit exceeded
	OUTCOME_ILL  = "ILL"  // illegal operation
	OUTCOME_ISE  = "ISE"  // internal server error
	OUTCOME_SKIP = "SKIP" // skipped judging
	OUTCOME_OLE  = "OLE"  // output limit exceeded
)

Variables

View Source
var (
	PORT               int
	MAX_THREADS        int
	TESTING_DIR        string
	CACHE_DIR          string
	DEBUG              bool
	SANDBOX            bool
	CLEANUP_SESSIONS   bool
	RLIMITS            bool
	JAVA_SANDBOX_AGENT string

	TasksToBeDone = new(int64)
	TasksInQueue  = new(int64)
)

Functions

func Debug

func Debug(str string)

Types

type JudgeSession

type JudgeSession struct {
	Workspace       string
	Code            string
	Language        string
	OriginalRequest *pb.TestSolutionRequest
	CommandFd       uintptr
	RunCommand      *exec.Cmd

	// limits set by adapters
	FSizeLimit int64
	NProcLimit int64
	MemLimit   uint64

	SandboxWithSeccomp bool
	SeccompProfile     util.SandboxProfile

	LanguageAdapter SmoothieAdapter
}

type JudgeStatus

type JudgeStatus struct {
	Err error                   // any possible errors
	Res pb.TestSolutionResponse // response to send back
}

type SmoothieAdapter

type SmoothieAdapter interface {
	GetName() string
	Compile(session *JudgeSession) (*exec.Cmd, error) // return command in the workspace
	JudgeFinished(tcr *pb.TestCaseResult)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL