wasm

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package wasm provides WebAssembly serverless function runtimes.

Package wasm provides WebAssembly serverless function runtimes.

Package wasm provides WebAssembly serverless function runtimes.

Package wasm provides WebAssembly serverless function runtimes.

Package wasm provides WebAssembly serverless function runtimes.

Index

Constants

View Source
const (
	WasmFuncStart = "_start"
	WasmFuncInit  = "yomo_init"
	// WasmFuncObserveDataTags guest module should implement this function
	WasmFuncObserveDataTags = "yomo_observe_datatags"
	// WasmFuncObserveDataTag host module should implement this function
	WasmFuncObserveDataTag  = "yomo_observe_datatag"
	WasmFuncGetWantedTarget = "yomo_get_wanted_target"
	WasmFuncWantedTarget    = "yomo_wanted_target"
	WasmFuncHandler         = "yomo_handler"
	WasmFuncWrite           = "yomo_write"
	WasmFuncWriteWithTarget = "yomo_write_with_target"
	WasmFuncContextTag      = "yomo_context_tag"
	WasmFuncContextData     = "yomo_context_data"
	WasmFuncContextDataSize = "yomo_context_data_size"
)

Define wasm import/export function names

Variables

This section is empty.

Functions

This section is empty.

Types

type Runtime

type Runtime interface {
	// Init loads the wasm file, and initialize the runtime environment
	Init(wasmFile string) error

	// GetObserveDataTags returns observed datatags of the wasm sfn
	GetObserveDataTags() []uint32

	// GetWantedTarget returns the wanted target of the wasm sfn
	GetWantedTarget() string

	// RunInit runs the init function of the wasm sfn
	RunInit() error

	// RunHandler runs the wasm application (request -> response mode)
	RunHandler(ctx serverless.Context) error

	// Close releases all the resources related to the runtime
	Close() error
}

Runtime is the abstract interface for wasm runtime

func NewRuntime

func NewRuntime(runtimeType string) (Runtime, error)

NewRuntime returns a specific wasm runtime instance according to the type parameter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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