capsule

package
v0.0.0-...-d76bbf2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallExportedOnExit

func CallExportedOnExit(wasmFile []byte)

func CallExportedOnLoad

func CallExportedOnLoad(wasmFile []byte)

func CreateWasmRuntime

func CreateWasmRuntime(ctx context.Context) wazero.Runtime

func ExecHandleFunction

func ExecHandleFunction(function api.Function, module api.Module, ctx context.Context, params ...uint64) (bytes []byte, err error)

ExecHandleFunction : params: pos1, length1, pos2, length2, ... Used by capsule-launcher/services/cli/cli.go - Execute

func ExecHandleFunctionForHttp

func ExecHandleFunctionForHttp(function api.Function, module api.Module, ctx context.Context, reqId uint64) (bytes []byte, err error)

ExecHandleFunctionForHttp : params: reqId Used by capsule-launcher/services/http/httpfiber.go - FiberServe

func ExecHandleVoidFunction

func ExecHandleVoidFunction(function api.Function, module api.Module, ctx context.Context, params ...uint64) (err error)

ExecHandleVoidFunction : params: pos1, length1, pos2, length2, ... Used by capsule-launcher/services/mqtt/mqtt.go - setHandler Used by capsule-launcher/services/nats/listen.go - Listen

func ExecVoidFunction

func ExecVoidFunction(function api.Function, module api.Module, ctx context.Context) (err error)

ExecVoidFunction : Used by capsule-launcher/services/wasmrt/wasmrunner.go - CallExportedOnExit - CallExportedOnLoad

func GetModuleFunctionForHttp

func GetModuleFunctionForHttp(wasmFile []byte) (module api.Module, function api.Function, context context.Context)

GetModuleFunctionForHttp : Used by capsule-launcher/services/http/httpfiber.go - FiberServe

func GetModuleInstance

func GetModuleInstance(wasmFile []byte) (api.Module, context.Context)

func GetNewWasmRuntime

func GetNewWasmRuntime(wasmFile []byte) (runtime wazero.Runtime, module api.Module, function api.Function, context context.Context)

GetNewWasmRuntime : Used by capsule-launcher/services/cli/cli.go - Execute

func GetNewWasmRuntimeForMqtt

func GetNewWasmRuntimeForMqtt(wasmFile []byte) (runtime wazero.Runtime, module api.Module, function api.Function, context context.Context)

GetNewWasmRuntimeForMqtt : Used by capsule-launcher/services/mqtt/mqtt.go - setHandler

func GetNewWasmRuntimeForNats

func GetNewWasmRuntimeForNats(wasmFile []byte) (runtime wazero.Runtime, module api.Module, function api.Function, context context.Context)

GetNewWasmRuntimeForNats : Used by capsule-launcher/services/nats/listen.go - Listen

func GetPackedPtrPositionAndSize

func GetPackedPtrPositionAndSize(result []uint64) (ptrPos uint32, size uint32)

func GetWasmFileFromUrl

func GetWasmFileFromUrl(wasmFileUrl, wasmFilePath string) ([]byte, error)

func GetWasmRuntimeAndModuleInstances

func GetWasmRuntimeAndModuleInstances(wasmFile []byte) (wazero.Runtime, api.Module, context.Context)

func ReserveMemorySpaceFor

func ReserveMemorySpaceFor(s string, wm api.Module, ctx context.Context) (pos uint64, length uint64, free api.Function, err error)

ReserveMemorySpaceFor : Reserve a place for a string parameter in the wasm module shared memory Used by capsule-launcher/services/cli/cli.go - Execute Used by capsule-launcher/services/mqtt/mqtt.go - setHandler Used by capsule-launcher/services/nats/listen.go - Listen

Types

This section is empty.

Jump to

Keyboard shortcuts

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