wasi

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 15 Imported by: 0

README

wasi

Project Badges

WASI runtime for tinywasm — module lifecycle management, host functions (pub/sub, WebSocket relay), and hot-reload support via wazero.

Docs

  • ARCHITECTURE.md — Package dependency graph and runtime message flow diagrams
  • WASI_SERVER.md — Full standalone server: WasiServer, Config, New(), ServerInterface implementation
  • HANDOFF_PROTOCOL.md — Hot-swap drain sequence and error cases
  • WASI_STRATEGY.md — Original module lifecycle split design (superseded by WASI_SERVER.md)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostBuilder added in v0.0.2

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

func NewHostBuilder added in v0.0.2

func NewHostBuilder(b bus.Bus, wsBroadcast func(topic string, msg []byte), logger func(msg ...any)) *HostBuilder

func (*HostBuilder) Build added in v0.0.2

type Module added in v0.0.2

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

func Load added in v0.0.2

func Load(ctx context.Context, name string, wasmBytes []byte, hb *HostBuilder) (*Module, error)

func (*Module) Close added in v0.0.2

func (m *Module) Close(ctx context.Context) error

func (*Module) Drain added in v0.0.2

func (m *Module) Drain(ctx context.Context, timeout time.Duration) error

func (*Module) Init added in v0.0.2

func (m *Module) Init(ctx context.Context) error

type WasiServer added in v0.0.2

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

func New

func New() *WasiServer

New creates a WasiServer with all defaults. Configure via Set* methods.

func (*WasiServer) Change added in v0.0.2

func (s *WasiServer) Change(string) error

func (*WasiServer) Label added in v0.0.2

func (s *WasiServer) Label() string

func (*WasiServer) Name added in v0.0.2

func (s *WasiServer) Name() string

func (*WasiServer) NewFileEvent added in v0.0.2

func (s *WasiServer) NewFileEvent(fileName, extension, filePath, event string) error

func (*WasiServer) RefreshUI added in v0.0.2

func (s *WasiServer) RefreshUI()

func (*WasiServer) RegisterRoutes added in v0.0.2

func (s *WasiServer) RegisterRoutes(fn func(*http.ServeMux)) *WasiServer

RegisterRoutes appends fn to the internal route list. Called before StartServer; matching the assetmin pattern.

func (*WasiServer) RestartServer added in v0.0.2

func (s *WasiServer) RestartServer() error

func (*WasiServer) SetAppRootDir added in v0.0.2

func (s *WasiServer) SetAppRootDir(dir string) *WasiServer

func (*WasiServer) SetBus added in v0.0.2

func (s *WasiServer) SetBus(b bus.Bus) *WasiServer

func (*WasiServer) SetDrainTimeout added in v0.0.2

func (s *WasiServer) SetDrainTimeout(d time.Duration) *WasiServer

func (*WasiServer) SetExitChan added in v0.0.2

func (s *WasiServer) SetExitChan(ch chan bool) *WasiServer

func (*WasiServer) SetLogger added in v0.0.2

func (s *WasiServer) SetLogger(fn func(msg ...any)) *WasiServer

func (*WasiServer) SetModulesDir added in v0.0.2

func (s *WasiServer) SetModulesDir(dir string) *WasiServer

func (*WasiServer) SetOutputDir added in v0.0.2

func (s *WasiServer) SetOutputDir(dir string) *WasiServer

func (*WasiServer) SetPort added in v0.0.2

func (s *WasiServer) SetPort(port string) *WasiServer

func (*WasiServer) SetUI added in v0.0.2

func (s *WasiServer) SetUI(ui interface{ RefreshUI() }) *WasiServer

func (*WasiServer) StartServer added in v0.0.2

func (s *WasiServer) StartServer(wg *sync.WaitGroup)

StartServer starts the server.

func (*WasiServer) StopServer added in v0.0.2

func (s *WasiServer) StopServer() error

func (*WasiServer) SupportedExtensions added in v0.0.2

func (s *WasiServer) SupportedExtensions() []string

func (*WasiServer) UnobservedFiles added in v0.0.2

func (s *WasiServer) UnobservedFiles() []string

func (*WasiServer) Value added in v0.0.2

func (s *WasiServer) Value() string

Jump to

Keyboard shortcuts

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