rwasm

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UseLogger

func UseLogger(l *vlog.Logger)

UseLogger sets the logger to be used by Wasm Runnables

Types

type FileFunc added in v0.9.0

type FileFunc func(string) ([]byte, error)

FileFunc is a function that returns the contents of a requested file

type HostFn

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

HostFn describes a host function callable from within a Runnable module

type Runner

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

Runner represents a wasm-based runnable

func NewRunner

func NewRunner(filepath string) *Runner

NewRunner returns a new *Runner

func NewRunnerWithRef added in v0.9.0

func NewRunnerWithRef(ref *WasmModuleRef, staticFileFunc FileFunc) *Runner

func (*Runner) OnChange

func (w *Runner) OnChange(evt rt.ChangeEvent) error

OnChange evt ChangeEventruns when a worker starts using this Runnable

func (*Runner) Run

func (w *Runner) Run(job rt.Job, ctx *rt.Ctx) (interface{}, error)

Run runs a Runner

type WasmModuleRef added in v0.9.0

type WasmModuleRef struct {
	Filepath string
	Name     string
	// contains filtered or unexported fields
}

WasmModuleRef is a reference to a Wasm module (either its filepath or its bytes)

func ModuleRefWithData added in v0.9.0

func ModuleRefWithData(name string, data []byte) *WasmModuleRef

func (*WasmModuleRef) ModuleBytes added in v0.9.0

func (w *WasmModuleRef) ModuleBytes() ([]byte, error)

ModuleBytes returns the bytes for the module

Jump to

Keyboard shortcuts

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