Documentation
¶
Index ¶
- func CompileFile(ctx context.Context, sandbox Sandbox, sourceCode []byte, lang models.Language) (string, error)
- func CopyFromSandbox(sandbox Sandbox, path string, w io.Writer) error
- func CopyInSandbox(sandbox Sandbox, path string, data []byte) error
- func GetBinaryName(config *models.Config, submissionId int) string
- func GetOutputFileName(config *models.Config, submission *models.Submission, test *models.Test) string
- func RandomString(size int) string
- type CheckerServices
- type CompileRequest
- type CompileResponse
- type CompileServices
- type EvaluatorServices
- type ExecuteRequest
- type ExecuteResponse
- type ExecuteServices
- type Handler
- type Limit
- type RunConfig
- type RunStatus
- type Sandbox
- type SandboxManager
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompileFile ¶
func GetOutputFileName ¶
func RandomString ¶
Types ¶
type CheckerServices ¶
type CheckerServices struct {
ProblemService services.ProblemService
TestService services.TestService
SubmissionService services.SubmissionService
SubmissionTestService services.SubmissionTestService
TestManager managers.TestManager
}
type CompileRequest ¶
type CompileResponse ¶
type CompileServices ¶
type CompileServices struct {
SubmissionService services.SubmissionService
}
type EvaluatorServices ¶
type EvaluatorServices struct {
ProblemService services.ProblemService
TestService services.TestService
SubmissionService services.SubmissionService
SubmissionTestService services.SubmissionTestService
TestManager managers.TestManager
}
func (*EvaluatorServices) CheckerServices ¶
func (s *EvaluatorServices) CheckerServices() *CheckerServices
func (*EvaluatorServices) CompileServices ¶
func (s *EvaluatorServices) CompileServices() *CompileServices
func (*EvaluatorServices) ExecuteServices ¶
func (s *EvaluatorServices) ExecuteServices() *ExecuteServices
type ExecuteRequest ¶
type ExecuteResponse ¶
type ExecuteServices ¶
type ExecuteServices struct {
ProblemService services.ProblemService
TestService services.TestService
SubmissionService services.SubmissionService
SubmissionTestService services.SubmissionTestService
TestManager managers.TestManager
}
type Handler ¶
type Handler interface {
Handle(next chan *models.Submission)
}
type RunConfig ¶
type RunConfig struct {
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
MemoryLimit int
StackLimit int
InputPath string
OutputPath string
TimeLimit float64
WallTimeLimit float64
MaxProcesses int
}
RunConfig represents the configuration for a Task.
type RunStatus ¶
type RunStatus struct {
Memory int `json:"memory"`
ExitCode int `json:"exitCode"`
ExitSignal int `json:"exitSignal"`
Killed bool `json:"killed"`
Message string `json:"message"`
Status string `json:"status"`
Time float64 `json:"time"`
WallTime float64 `json:"wallTime"`
}
RunStatus is what is returned after a task has been run.
type Sandbox ¶
type Sandbox interface {
GetID() int
GetPath(path string) string
CreateDirectory(path string, perm fs.FileMode) error
DeleteDirectory(path string) error
CreateFile(path string, perm fs.FileMode) error
WriteToFile(path string, data []byte, perm fs.FileMode) error
ReadFile(path string) ([]byte, error)
DeleteFile(path string) error
ExecuteCommand(ctx context.Context, command []string, config *RunConfig) (*RunStatus, error)
Cleanup() error
}
type SandboxManager ¶
Click to show internal directories.
Click to hide internal directories.