client

package
v0.0.0-...-c5bc0ce Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// GetJob send request to server asking for a job to execute. When there are no available jobs, GetJob will gives
	// ErrNoSuchJob error. When there is a job available, GetJob will return `Job` struct that contains token and spec.
	// The spec field in `Job` struct is a `ReadCloser`, so you need to close it when it no longer used. You don't have
	// to close it if `GetJob` gives you an error.
	GetJob(ctx context.Context, token string) (*Job, error)

	// SubmitJob send grading result of a job to the server.
	SubmitJob(ctx context.Context, token string, jobResult JobResult) error
}

Client is used for interacting with ugrade server API.

func New

func New(serverURL string) Client

New create new default implementation of `Client`.

type Job

type Job struct {
	Token string
	Spec  io.ReadCloser
}

Job represent grading job in ugrade.

type JobResult

type JobResult struct {
	Job     *Job
	Output  io.ReadCloser
	Verdict ugrade.Verdict
}

JobResult respresent of result after job finished.

Jump to

Keyboard shortcuts

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