wasmhost

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeFrame

func EncodeFrame(frame Frame) ([]byte, error)

func NewResolver

func NewResolver(ctx *compiler.Context) *resolver.NSResolver

Types

type Frame

type Frame struct {
	ID          string   `json:"id,omitempty"`
	Session     string   `json:"session,omitempty"`
	Op          string   `json:"op,omitempty"`
	Kind        string   `json:"kind"`
	FormIndex   int      `json:"form_index,omitempty"`
	Stage       string   `json:"stage,omitempty"`
	Artifact    string   `json:"artifact,omitempty"`
	ContentType string   `json:"content_type,omitempty"`
	Content     any      `json:"content,omitempty"`
	Text        string   `json:"text,omitempty"`
	Value       string   `json:"value,omitempty"`
	Status      []string `json:"status,omitempty"`
}

type Host

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

func New

func New(consts *vm.Consts) *Host

func (*Host) Handle

func (h *Host) Handle(req Request, emit func(string))

func (*Host) HandleJSON

func (h *Host) HandleJSON(reqJSON string, emit func(string)) string

type InspectOptions

type InspectOptions struct {
	Bytecode          bool `json:"bytecode,omitempty"`
	IR                bool `json:"ir,omitempty"`
	OptimizedBytecode bool `json:"optimized_bytecode,omitempty"`
	LoweredGo         bool `json:"lowered_go,omitempty"`
}

type Request

type Request struct {
	ID      string         `json:"id,omitempty"`
	Session string         `json:"session,omitempty"`
	Op      string         `json:"op"`
	NS      string         `json:"ns,omitempty"`
	Code    string         `json:"code,omitempty"`
	Inspect InspectOptions `json:"inspect,omitempty"`
}

func DecodeRequest

func DecodeRequest(bs []byte) (Request, error)

Jump to

Keyboard shortcuts

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