judge

package
v0.0.0-...-6ad1837 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NoInteractor tells the judge to execute the problem solution without any interactor.
	NoInteractor = ""

	// DefaultInteractor tells the judge to execute the problem solution through the default
	// interactor, which discretely streams the input of each test case to the solution program and
	// discretely collects the output of each test case.
	DefaultInteractor = "default-interactor"

	// CustomInteractor tells the judge to execute the problem solution through a custom interactor
	// which is supposed to be inside the problem bundle.
	CustomInteractor = "custom-interactor"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor struct {
	// BundleRequestURL is the URL endpoint to download the problem bundle.
	BundleRequestURL string

	// BundleRequestHeaders are the HTTP headers to be sent when downloading the problem bundle.
	BundleRequestHeaders http.Header

	// SolutionRequestURL is the URL endpoint to download the problem solution.
	SolutionRequestURL string

	// SolutionRequestHeaders are the HTTP headers to be sent when downloading the problem solution.
	SolutionRequestHeaders http.Header

	// Interactor identifies the execution style of the problem solution, defining the interactor
	// program that should feed input and collect output to/from the solution process, where the
	// values allowed are NoInteractor (just feed the input file and collect the output),
	// DefaultInteractor (read a line from the input file with the number of following lines to read
	// and feed to the solution process, then read a line from the solution process output with the
	// number of following lines to read and store, then start again), or a path to an interactor
	// source code within the uncompressed bundle.
	Interactor string

	// UploadAuthorizedServerURL is the URL endpoint to get an authorized upload request for the
	// compressed outputs of the problem solution.
	UploadAuthorizedServerURL string

	// FileService offers the necessary file operations for Executor.
	FileService file.Service

	// InteractorProgramService offers methods to compile and execute the interactor.
	InteractorProgramService program.Service

	// SolutionProgramService offers methods to compile and execute the solution.
	SolutionProgramService program.Service

	// InteractorCage restricts the interactor process.
	InteractorCage cage.Cage

	// SolutionCage restricts the solution process.
	SolutionCage cage.Cage
	// contains filtered or unexported fields
}

Executor is the program to execute a programming problem solution feeding it with a set of tests and to upload the results to the given endpoints.

func (*Executor) Execute

func (e *Executor) Execute() error

Execute is the program to execute a programming problem solution feeding it with a set of tests and to upload the results to the given endpoints.

Jump to

Keyboard shortcuts

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