Documentation
¶
Index ¶
- func AddProgLang(name, extension string, runner CodeRunner)
- type Anubis
- type AnubisConfig
- type CodeRunner
- type CommandRunner
- type LineChecker
- type LocalCmdRunner
- type LocalIsolateRunner
- type LocalNsjailRunner
- type ProgLang
- type RunOutput
- type Submission
- type SubmissionOut
- type SubmissionStatus
- type TestCases
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddProgLang ¶
func AddProgLang(name, extension string, runner CodeRunner)
Types ¶
type Anubis ¶
type Anubis struct { Logger *slog.Logger CommandRunner CommandRunner }
func NewAnubis ¶
func NewAnubis(ac AnubisConfig) Anubis
func (*Anubis) NewSubmission ¶
func (a *Anubis) NewSubmission(codeFile *os.File, testCases TestCases) Submission
type AnubisConfig ¶
type AnubisConfig struct { Logger *slog.Logger CommandRunner CommandRunner }
type CodeRunner ¶
type CodeRunner func(codeFile *os.File, commandRunner CommandRunner) (RunOutput, error)
type CommandRunner ¶
type LineChecker ¶
maps test input files with their expected output files
type LocalCmdRunner ¶
func (*LocalCmdRunner) RunCommand ¶
func (lcr *LocalCmdRunner) RunCommand(command *exec.Cmd) (RunOutput, error)
func (*LocalCmdRunner) SetInput ¶
func (lcr *LocalCmdRunner) SetInput(file *os.File)
type LocalIsolateRunner ¶
func (*LocalIsolateRunner) RunCommand ¶
func (lir *LocalIsolateRunner) RunCommand(command *exec.Cmd) (RunOutput, error)
func (*LocalIsolateRunner) SetInput ¶
func (lir *LocalIsolateRunner) SetInput(file *os.File)
type LocalNsjailRunner ¶
func (*LocalNsjailRunner) RunCommand ¶
func (lnr *LocalNsjailRunner) RunCommand(command *exec.Cmd) (RunOutput, error)
func (*LocalNsjailRunner) SetInput ¶
func (lnr *LocalNsjailRunner) SetInput(file *os.File)
type ProgLang ¶
type ProgLang struct { Name string Runner CodeRunner }
Programming Languages
func GetProgLang ¶
type RunOutput ¶
func PythonRunner ¶
func PythonRunner(codeFile *os.File, commandRunner CommandRunner) (RunOutput, error)
type Submission ¶
type Submission struct { CodeFile *os.File TestCases TestCases CommandRunner CommandRunner Logger *slog.Logger }
func (*Submission) CheckAll ¶
func (s *Submission) CheckAll() (SubmissionOut, error)
type SubmissionOut ¶
type SubmissionStatus ¶
type SubmissionStatus int
const ( AC SubmissionStatus = iota CompileError RunTimeError Failed InternalError )
type TestCases ¶
type TestCases struct { InputOutput map[string]string LineChecker LineChecker }
Click to show internal directories.
Click to hide internal directories.