api

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAvailable = errors.New("resource is not available for now")

Functions

func GetFile

func GetFile(url string, path string) error

func GetScript

func GetScript(name string) (*os.File, error)

To ensure the atomicity of updating script, this function SHOULD NOT be used in functions other than judge.EnsureLatestScript.

func UpdateRun

func UpdateRun(id uint, request *request.UpdateRunRequest, runFile, buildOutputFile, compareOutputFile io.Reader) error

Types

type Task

type Task struct {
	RunID    uint            `json:"run_id"`
	Language models.Language `json:"language"`

	TestCaseID        uint      `json:"test_case_id"`
	InputFile         string    `json:"input_file"`  // pre-signed url
	OutputFile        string    `json:"output_file"` // same as above
	TestCaseUpdatedAt time.Time `json:"test_case_updated_at"`

	CodeFile string `json:"code_file"`

	InputFilePath     string
	OutputFilePath    string
	RunFilePath       string
	BuildOutputPath   string
	CompareOutputPath string
	JudgeDir          string

	MemoryLimit        uint64        `json:"memory_limit"` // Byte
	TimeLimit          uint          `json:"time_limit"`   // ms
	BuildArg           string        `json:"build_arg"`    // E.g.  O2=false
	CompareScript      models.Script `json:"compare_script"`
	TimeUsed           uint
	MemoryUsed         uint
	OutputStrippedHash string
}

func GetTask

func GetTask() (*Task, error)

func (*Task) GenerateFilePath

func (t *Task) GenerateFilePath()

Jump to

Keyboard shortcuts

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