moduleref

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WasmModuleRef

type WasmModuleRef struct {
	Name string `json:"name"`
	FQFN string `json:"fqfn"`
	Data []byte `json:"data"`
	// contains filtered or unexported fields
}

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

func RefWithData

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

RefWithData returns a module ref from module bytes

func RefWithReader

func RefWithReader(name, fqfn string, reader io.Reader) *WasmModuleRef

RefWithReader returns a module ref from module bytes

func (*WasmModuleRef) Bytes

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

Bytes returns the bytes for the module

func (*WasmModuleRef) MarshalJSON

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

MarshalJSON adds a custom marshaller to WasmModuleRef to ensure that bytes are read before encoding to JSON

Jump to

Keyboard shortcuts

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