playground

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxFiles      = 128
	DefaultMaxFileBytes  = 256 * 1024
	DefaultMaxTotalBytes = 2 * 1024 * 1024
)

Variables

This section is empty.

Functions

func ExecutionTimeout

func ExecutionTimeout() time.Duration

func PolicyJSON

func PolicyJSON(policy Policy) ([]byte, error)

func RejectSecretEnvironment

func RejectSecretEnvironment(env []string) error

func SanitizedEnvironment

func SanitizedEnvironment(cacheRoot string) []string

func SecretLikeEnvName

func SecretLikeEnvName(name string) bool

func SecretLikePathName

func SecretLikePathName(rel string) bool

func UnsafeExportDirectory

func UnsafeExportDirectory(rel string) bool

func UnsafeExportFile

func UnsafeExportFile(rel string) bool

Types

type ExportResult

type ExportResult struct {
	Archive string `json:"archive"`
	Files   []File `json:"files"`
}

func ExportArchive

func ExportArchive(sourceDir string, archivePath string, options Options) (ExportResult, error)

type File

type File struct {
	Path string `json:"path"`
	Size int64  `json:"size"`
}

func CollectFiles

func CollectFiles(sourceDir string, options Options) ([]File, error)

type Limits

type Limits struct {
	WallClockSeconds int   `json:"wallClockSeconds"`
	MaxFiles         int   `json:"maxFiles"`
	MaxFileBytes     int64 `json:"maxFileBytes"`
	MaxTotalBytes    int64 `json:"maxTotalBytes"`
	MaxOutputBytes   int64 `json:"maxOutputBytes"`
}

type Options

type Options struct {
	MaxFiles      int
	MaxFileBytes  int64
	MaxTotalBytes int64
}

type Policy

type Policy struct {
	HostedExecutionEnabled bool     `json:"hostedExecutionEnabled"`
	Workspace              string   `json:"workspace"`
	Network                string   `json:"network"`
	Filesystem             string   `json:"filesystem"`
	Persistence            string   `json:"persistence"`
	VersionPinning         string   `json:"versionPinning"`
	Export                 string   `json:"export"`
	Limits                 Limits   `json:"limits"`
	Environment            []string `json:"environment"`
	RequiredAbuseControls  []string `json:"requiredAbuseControls"`
}

func DefaultPolicy

func DefaultPolicy() Policy

type Workspace

type Workspace struct {
	Root  string
	Files []File
}

func StageWorkspace

func StageWorkspace(sourceDir string, options Options) (Workspace, func() error, error)

Jump to

Keyboard shortcuts

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