gvisorhelper

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, stdin io.Reader, stdout io.Writer, _ io.Writer) error

Run executes one helper request from stdin and writes a response to stdout.

Types

type Request

type Request struct {
	Version   string                 `json:"version"`
	SessionID string                 `json:"session_id"`
	Command   string                 `json:"command"`
	GuestCwd  string                 `json:"guest_cwd"`
	TimeoutMs int64                  `json:"timeout_ms"`
	Env       map[string]string      `json:"env,omitempty"`
	Limits    sandbox.ResourceLimits `json:"limits"`
}

Request is the stdin protocol payload for helper mode.

type Response

type Response struct {
	Success    bool   `json:"success"`
	ExitCode   int    `json:"exit_code"`
	Stdout     string `json:"stdout"`
	Stderr     string `json:"stderr"`
	DurationMs int64  `json:"duration_ms"`
	Error      string `json:"error,omitempty"`
}

Response is the stdout protocol payload for helper mode.

func ExecuteRequest

func ExecuteRequest(ctx context.Context, req Request) Response

func Invoke

func Invoke(ctx context.Context, req Request, helperFlag string) (Response, error)

Invoke executes helper mode via self-exec when possible. Test binaries fall back to in-process execution because they do not expose the hidden helper flag through the generated test main.

Jump to

Keyboard shortcuts

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