debuglet

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompileError

type CompileError struct{ Err error }

CompileError is a module that wazero did not compile. Err is wazero's description of the failure, which can quote names from the module itself.

func (*CompileError) Error

func (e *CompileError) Error() string

func (*CompileError) Unwrap

func (e *CompileError) Unwrap() error

type Debuglet

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

Debuglet is the engine that loads, initialises, and runs a single WASM debuglet module. One Debuglet instance corresponds to one session.

func New

func New(logger *zap.Logger, debugletID uuid.UUID, transactionID string, policy scheduler.Policy, operator netpolicy.Operator, schedule *tesla.KeySchedule, limiter *app.Limiter, pc ratelimit.PacketCount, iface *net.Interface, portManager *socket.PortManager) *Debuglet

New creates a ready-to-initialise Debuglet backed by a wazero Runtime. operator is the executor's network policy; together with the run's declared destinations it decides every transport the guest can use.

func (*Debuglet) Close

func (d *Debuglet) Close(ctx context.Context) error

Close terminates owned I/O and runtime resources exactly once. While InitRuntime is still running, Close leaves the runtime and any compiled module it published to InitRuntime, which releases them once on return. It does not wait for Run or its caller's watcher: the executor joins those separately. The context reaches wazero; it cannot force an arbitrary socket Close to end.

func (*Debuglet) GetSCIONAddr

func (d *Debuglet) GetSCIONAddr() string

GetSCIONAddr returns the local SCION address of the server listener started during Init.

func (*Debuglet) ID

func (d *Debuglet) ID() uuid.UUID

func (*Debuglet) InitRuntime

func (d *Debuglet) InitRuntime(ctx context.Context, wasmBytes []byte) error

InitRuntime starts the network servers and compiles and instantiates the WASM module. It must be called exactly once before Run.

func (*Debuglet) Registry

func (d *Debuglet) Registry() *socket.SocketRegistry

func (*Debuglet) Run

func (d *Debuglet) Run(ctx context.Context, outputCh chan<- []byte, args []string) error

Run executes the debuglet's "_start" WASM export, streams stdout/stderr back through outputCh, and returns any execution error. The outputCh channel is closed when the debuglet finishes execution.

func (*Debuglet) StartServers

func (d *Debuglet) StartServers(ctx context.Context, req StartServersReq) error

startServers starts the network listeners required by this debuglet instance. Currently only the SCION/UDP listener is active; TCP and plain UDP are reserved for future use.

type StartServersReq

type StartServersReq struct {
	UDP   bool
	TCP   bool
	SCION bool
}

Directories

Path Synopsis
Package netpolicy holds the one network policy the executor applies to guest traffic: which transports a guest may use, which destinations it may reach, and on which ports.
Package netpolicy holds the one network policy the executor applies to guest traffic: which transports a guest may use, which destinations it may reach, and on which ports.
Package wasm contains the WASM host function implementations that are imported by WASM modules at runtime.
Package wasm contains the WASM host function implementations that are imported by WASM modules at runtime.

Jump to

Keyboard shortcuts

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