Documentation ¶
Index ¶
- Constants
- Variables
- func Compile(compileConfig utils.CompileConfig, code string, language string) (string, error)
- func DelFile(fileId string)
- func Judge(problem entity.Problem, judge entity.Judge) map[string]interface{}
- func JudgeAllCase(problem entity.Problem, judgeLanguage string, userFileId string, ...) ([]runResult, error)
- func NewDetailedOJError(code ErrCode, msg string, stdout string, stderr string) errordeprecated
- func NewFullOJError(code ErrCode, msg string, stdout string, stderr string) error
- func NewOJError(code ErrCode) error
- func NewRawOJError(code ErrCode) error
- func SendCompileReq(maxCpuTime int64, maxRealTime int64, maxMemory int64, maxStack int64, ...) gjson.Result
- func StackTraceOJError(e error) string
- type CommandArgs
- type ErrCode
- type OJError
Constants ¶
View Source
const ( STACK_LIMIT_MB = 128 STDIO_SIZE_MB = 32 SANDBOX_BASE_URL = "http://localhost:6050" MAX_PROCESS_NUMBER = 128 )
Variables ¶
View Source
var COMPILE_FILES = []map[string]interface{}{ { "content": "", }, { "name": "stdout", "max": 1024 * 1024 * STDIO_SIZE_MB, }, { "name": "stderr", "max": 1024 * 1024 * STDIO_SIZE_MB, }, }
Functions ¶
func JudgeAllCase ¶
func JudgeAllCase(problem entity.Problem, judgeLanguage string, userFileId string, userFileContent string, judgeCaseMode string) ([]runResult, error)
JudgeAllCase judge all cases; However only default is supported
func NewFullOJError ¶
func NewOJError ¶
NewOJError creates an OJError with wrap option.
func NewRawOJError ¶
func SendCompileReq ¶
func SendCompileReq(maxCpuTime int64, maxRealTime int64, maxMemory int64, maxStack int64, srcName string, exeName string, args []string, envs []string, code string) gjson.Result
SendCompileReq build and give compile request.
func StackTraceOJError ¶
StackTraceOJError gives all message and stack info if there's.
Types ¶
type CommandArgs ¶
type CommandArgs struct { Id int JudgeGlobalDTO entity.JudgeGlobalCfg Input string // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.