wasm

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Overview

Package wasm implement the wasm framework for MOSN

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyPluginName   = errors.New("wasm config without plugin name")
	ErrUnexpectedType    = errors.New("unexpected object type in map")
	ErrPluginNotFound    = errors.New("wasm plugin not found")
	ErrSameWasmConfig    = errors.New("update with same wasm config")
	ErrUpdateInstanceNum = errors.New("update instance num return 0")
)
View Source
var (
	ErrEngineNotFound     = errors.New("fail to get wasm engine")
	ErrWasmBytesLoad      = errors.New("fail to load wasm bytes")
	ErrWasmBytesIncorrect = errors.New("incorrect hash of wasm bytes")
	ErrInstanceCreate     = errors.New("fail to create wasm instance")
	ErrModuleCreate       = errors.New("fail to create wasm module")
)

Functions

func GetWasmEngine

func GetWasmEngine(name string) types.WasmVM

GetWasmEngine returns the wasm vm(engine) by name.

func GetWasmManager

func GetWasmManager() types.WasmManager

GetWasmManager returns the global singleton of types.WasmManager.

func NewWasmPlugin

func NewWasmPlugin(wasmConfig v2.WasmPluginConfig) (types.WasmPlugin, error)

func RegisterWasmEngine

func RegisterWasmEngine(name string, engine types.WasmVM)

RegisterWasmEngine registers a wasm vm(engine).

Types

type DefaultWasmPluginHandler

type DefaultWasmPluginHandler struct{}

DefaultWasmPluginHandler is the default implementation of types.WasmPluginHandler.

func (*DefaultWasmPluginHandler) OnConfigUpdate

func (d *DefaultWasmPluginHandler) OnConfigUpdate(config v2.WasmPluginConfig)

func (*DefaultWasmPluginHandler) OnPluginDestroy

func (d *DefaultWasmPluginHandler) OnPluginDestroy(plugin types.WasmPlugin)

func (*DefaultWasmPluginHandler) OnPluginStart

func (d *DefaultWasmPluginHandler) OnPluginStart(plugin types.WasmPlugin)

Directories

Path Synopsis
abi
runtime

Jump to

Keyboard shortcuts

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