toolhost

package
v0.7.21 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package toolhost implements the host-side toolbox for WASM sandboxes (plans/wasm-runtime.md §3).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SandboxID string
	WorkDir   string
	AuthToken string
	Exec      Executor
	StateKV   StateKV
	Sessions  *sessions.Manager
}

Config wires a toolbox host for one sandbox.

type Executor

type Executor interface {
	Exec(r *http.Request, req models.ExecRequest) (models.ExecResult, error)
}

Executor runs a WASM invocation for toolbox /process/execute.

type Host

type Host struct {
	// contains filtered or unexported fields
}

Host serves toolbox HTTP routes against a sandbox workdir on the host.

func New

func New(cfg Config) *Host

New constructs a toolbox host.

func (*Host) Handler

func (h *Host) Handler() http.Handler

Handler returns an http.Handler implementing the core toolbox surface.

type StateKV

type StateKV interface {
	Get(ctx context.Context, sandboxID, key string) ([]byte, bool, error)
	Set(ctx context.Context, sandboxID, key string, value []byte) error
	Delete(ctx context.Context, sandboxID, key string) error
	ListKeys(ctx context.Context, sandboxID string) ([]string, error)
}

StateKV exposes durable host-KV over toolbox HTTP for wasm runtime=durable workloads.

Jump to

Keyboard shortcuts

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