Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WaitOrStop ¶
func WaitOrStop(ctx context.Context, cmd *exec.Cmd, interrupt os.Signal, killDelay time.Duration) error
WaitOrStop waits for the already-started command cmd by calling its Wait method.
If cmd does not return before ctx is done, WaitOrStop sends it the given interrupt signal. If killDelay is positive, WaitOrStop waits that additional period for Wait to return before sending os.Kill.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Handler is a struct which represents the backend handler
func NewController ¶
NewController creates a new controller
func (*Controller) Compile ¶
func (c *Controller) Compile(ctx context.Context, sourceCode string) (*serialize.ExecutionResponse, error)
Compile compiles the given source code
func (*Controller) GetExecutionSteps ¶
func (c *Controller) GetExecutionSteps(ctx context.Context, sourceCode string) (serialize.ExecutionResponse, error)
GetExecutionSteps gets the execution steps for the given source code
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder records the standard and error outputs of a sandbox program (comprised of playback headers) and converts it to a sequence of Events. It sanitizes each Event's Message to ensure it is valid UTF-8.
Playground programs precede all their writes with a header (described below) that describes the time the write occurred (in playground time) and the length of the data that will be written. If a non-header is encountered where a header is expected, the output is scanned for the next header and the intervening text string is added to the sequence an event occurring at the same time as the preceding event.
A playback header has this structure:
4 bytes: "\x00\x00PB", a magic header 8 bytes: big-endian int64, unix time in nanoseconds 4 bytes: big-endian int32, length of the next write