types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limit

type Limit struct {
	TimeLimit   time.Duration // user CPU time limit (in ns)
	MemoryLimit Size          // user memory limit (in bytes)
}

Limit represents the resource limit for traced process

func (Limit) String

func (l Limit) String() string

type Result

type Result struct {
	Status            // result status
	ExitStatus int    // exit status (signal number if signalled)
	Error      string // potential detailed error message (for program runner error)

	Time   time.Duration // used user CPU time  (underlying type int64 in ns)
	Memory Size          // used user memory    (underlying type uint64 in bytes)

	// metrics for the program runner
	SetUpTime   time.Duration
	RunningTime time.Duration
}

Result is the program runner result

func (Result) String

func (r Result) String() string

type Size

type Size uint64

Size stores number of byte for the object. E.g. Memory. Maximun size is bounded by 64-bit limit

func (Size) Byte

func (s Size) Byte() uint64

Byte return size in bytes

func (Size) EiB

func (s Size) EiB() uint64

EiB return size in EiB

func (Size) GiB

func (s Size) GiB() uint64

GiB return size in GiB

func (Size) KiB

func (s Size) KiB() uint64

KiB return size in KiB

func (Size) MiB

func (s Size) MiB() uint64

MiB return size in MiB

func (Size) PiB

func (s Size) PiB() uint64

PiB return size in PiB

func (Size) String

func (s Size) String() string

String stringer interface for print

func (Size) TiB

func (s Size) TiB() uint64

TiB return size in TiB

type Status

type Status int

Status is the result Status

const (
	StatusInvalid Status = iota // 0 not initialized
	// Normal
	StatusNormal // 1 normal

	// Resource Limit Exceeded
	StatusTimeLimitExceeded   // 2 tle
	StatusMemoryLimitExceeded // 3 mle
	StatusOutputLimitExceeded // 4 ole

	// Unauthorized Access
	StatusDisallowedSyscall // 5 ban

	// Runtime Error
	StatusSignalled         // 6 signalled
	StatusNonzeroExitStatus // 7 nonzero exit status

	// Programmer Runner Error
	StatusRunnerError // 8 runner error
)

Result Status for program runner

func (Status) Error

func (t Status) Error() string

func (Status) String

func (t Status) String() string

Jump to

Keyboard shortcuts

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