wasm

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WASMComponentProviderName             = "wasm-component"
	WASMComponentOperationRun             = "run-wasm-component"
	ProductCaptureBrowserProviderName     = "product-capture-browser"
	ProductCaptureBrowserOperationCapture = "capture-product-browser"
	ProductCaptureProviderBinaryPath      = "provider/product-capture-provider"
	ProductCaptureRequestPath             = "request.json"
	ProductCaptureSnapshotPath            = "snapshot.json"
	DefaultWASMABI                        = "wasm-export-i32-v1"
)

Variables

This section is empty.

Functions

func BoundedWASMStdin

func BoundedWASMStdin(input json.RawMessage) *bytes.Reader

func ProductCaptureBrowserContract

func ProductCaptureBrowserContract(descriptor core.RuntimeDescriptor) core.RuntimeAdapterContract

func ProductCaptureCommand

func ProductCaptureCommand() []string

func SHA256Ref

func SHA256Ref(data []byte) string

func WASMComponentContract

func WASMComponentContract(descriptor core.RuntimeDescriptor) core.RuntimeAdapterContract

func WASMMemoryLimitPages

func WASMMemoryLimitPages(memoryBytes int64) uint32

func WriteStrictJSON

func WriteStrictJSON(path string, value any) error

Types

type ProductCaptureBrowserInvocationOptions

type ProductCaptureBrowserInvocationOptions struct {
	TaskID    string
	LeaseID   string
	Image     string
	Workspace string
	Network   string
	Timeout   time.Duration
	Workload  core.ProductCaptureWorkload
	Limits    core.ResourceLimits
}

type ProductCaptureBrowserRuntime

type ProductCaptureBrowserRuntime interface {
	RunProductCaptureBrowser(context.Context, ProductCaptureBrowserRuntimeInvocation) (core.RuntimeExecutionResult, error)
}

type ProductCaptureBrowserRuntimeInvocation

type ProductCaptureBrowserRuntimeInvocation struct {
	Request   core.RuntimeExecutionRequest
	Image     string
	Workspace string
	Network   string
	Timeout   time.Duration
}

type ProductCaptureProviderRequest

type ProductCaptureProviderRequest struct {
	Workload core.ProductCaptureWorkload `json:"workload"`
}

type RuntimeAdapterCatalogDocument

type RuntimeAdapterCatalogDocument struct {
	Version                   string                       `json:"version"`
	ProtocolVersion           string                       `json:"protocol_version"`
	Adapters                  []RuntimeAdapterCatalogEntry `json:"adapters"`
	HostOwnedResponsibilities []string                     `json:"host_owned_responsibilities"`
}

func (RuntimeAdapterCatalogDocument) Validate

func (d RuntimeAdapterCatalogDocument) Validate() error

type RuntimeAdapterCatalogEntry

type RuntimeAdapterCatalogEntry struct {
	AdapterID           string                      `json:"adapter_id"`
	Operation           string                      `json:"operation"`
	Kinds               []core.RuntimeAdapterKind   `json:"kinds"`
	WorkloadKinds       []core.WorkloadKind         `json:"workload_kinds"`
	RuntimeProfiles     []core.RuntimeProfile       `json:"runtime_profiles"`
	WorkspacePolicy     core.RuntimeWorkspacePolicy `json:"workspace_policy"`
	ConformanceProfiles []string                    `json:"conformance_profiles"`
}

func (RuntimeAdapterCatalogEntry) Contract

func (RuntimeAdapterCatalogEntry) Validate

func (e RuntimeAdapterCatalogEntry) Validate() error

type SandboxRuntimeProductCaptureBrowserAdapter

type SandboxRuntimeProductCaptureBrowserAdapter struct {
	Runtime computecontainer.SandboxRuntime
}

func (SandboxRuntimeProductCaptureBrowserAdapter) RunProductCaptureBrowser

type WASMInvocationOptions

type WASMInvocationOptions struct {
	TaskID   string
	LeaseID  string
	Kind     core.WorkloadKind
	WASM     *core.WASMWorkload
	Provider *core.ProviderWorkload
	Limits   core.ResourceLimits
}

type WASMRunRequest

type WASMRunRequest struct {
	ProtocolVersion string              `json:"protocol_version"`
	TaskID          string              `json:"task_id"`
	LeaseID         string              `json:"lease_id"`
	ProviderConfig  core.ProviderConfig `json:"provider_config,omitzero"`
	ComponentRef    string              `json:"component_ref"`
	ComponentDigest string              `json:"component_digest"`
	ABI             string              `json:"abi"`
	Operation       string              `json:"operation"`
	Input           json.RawMessage     `json:"input"`
	Component       []byte              `json:"-"`
	Workspace       string              `json:"-"`
	Limits          core.ResourceLimits `json:"-"`
}

func NewWASMRunRequest

func NewWASMRunRequest(opts WASMInvocationOptions) (WASMRunRequest, error)

func (WASMRunRequest) Validate

func (r WASMRunRequest) Validate() error

type WASMRunResult

type WASMRunResult = core.RuntimeExecutionResult

type WASMRuntime

type WASMRuntime interface {
	RunWASM(context.Context, WASMRunRequest) (WASMRunResult, error)
}

type WazeroRuntime

type WazeroRuntime struct{}

func (WazeroRuntime) RunWASM

Jump to

Keyboard shortcuts

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