Documentation ¶
Index ¶
- Variables
- func CheckRequireFilesExists(config *commonStructs.JudgeConfiguration, configDir string) error
- func CompileSpecialJudgeCodeFile(source, name, binRoot, configDir, libraryDir, lang string) (string, error)
- func GetOrCreateBinaryRoot(config *commonStructs.JudgeConfiguration) (string, error)
- func Max(x, y int64) int64
- func Max32(a, b int) int
- type JudgeSession
- func (session *JudgeSession) Clean()
- func (session *JudgeSession) DiffText(result *commonStructs.TestCaseResult) error
- func (session *JudgeSession) GetCompiler(codeStr string) (provider.CodeCompileProviderInterface, error)
- func (session *JudgeSession) JudgeOnce(judgeResult *commonStructs.TestCaseResult)
- func (session *JudgeSession) RunJudge() commonStructs.JudgeResult
- func (session *JudgeSession) SaveConfiguration(userConfirm bool) error
- type PArgs
- type ProcessInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ExtraEnviron = []string{"PYTHONIOENCODING=utf-8"}
ExtraEnviron 额外需要被注入的环境变量
Functions ¶
func CheckRequireFilesExists ¶
func CheckRequireFilesExists(config *commonStructs.JudgeConfiguration, configDir string) error
CheckRequireFilesExists 检查配置文件里的所有文件是否存在
func CompileSpecialJudgeCodeFile ¶
func CompileSpecialJudgeCodeFile(source, name, binRoot, configDir, libraryDir, lang string) (string, error)
CompileSpecialJudgeCodeFile 普通特殊评测的编译方法
func GetOrCreateBinaryRoot ¶
func GetOrCreateBinaryRoot(config *commonStructs.JudgeConfiguration) (string, error)
GetOrCreateBinaryRoot 获取二进制文件的目录
Types ¶
type JudgeSession ¶
type JudgeSession struct { SessionID string // Judge Session Id SessionRoot string // Session Root Directory SessionDir string // Session Directory ConfigFile string // Config file ConfigDir string // Config file dir CodeLangName string // Code file language name CodeFile string // Code File Path LibraryDir string // Compile Library Path for Working Program Commands []string // Executable program commands JudgeConfig commonStructs.JudgeConfiguration // Judge Configurations Compiler provider.CodeCompileProviderInterface // Compiler entity Logger *logger.JudgeLogger // Judge Logger Timeout int // Process timeout (s) }
JudgeSession 评测会话类
func NewSessionWithLog ¶
func NewSessionWithLog(configFile string, print bool, level int) (*JudgeSession, error)
NewSessionWithLog 创建一个包含日志的对象
func (*JudgeSession) DiffText ¶
func (session *JudgeSession) DiffText(result *commonStructs.TestCaseResult) error
DiffText Compare the text 进行文本比较
func (*JudgeSession) GetCompiler ¶
func (session *JudgeSession) GetCompiler(codeStr string) (provider.CodeCompileProviderInterface, error)
GetCompiler get a compiler provider from session.CodeLangName 如果不设置codeStr,默认会读取配置文件里的code_file字段并打开对应文件
func (*JudgeSession) JudgeOnce ¶
func (session *JudgeSession) JudgeOnce(judgeResult *commonStructs.TestCaseResult)
JudgeOnce 基于JudgeOptions进行评测调度
func (*JudgeSession) RunJudge ¶
func (session *JudgeSession) RunJudge() commonStructs.JudgeResult
RunJudge 执行评测
func (*JudgeSession) SaveConfiguration ¶
func (session *JudgeSession) SaveConfiguration(userConfirm bool) error
SaveConfiguration 保存评测会话
type ProcessInfo ¶
type ProcessInfo struct { Pid int `json:"pid"` Process *cmd.Process `json:"-"` Status syscall.WaitStatus `json:"status"` Rusage *syscall.Rusage `json:"rusage"` }
ProcessInfo 进程信息
Click to show internal directories.
Click to hide internal directories.