wasm

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Package

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

Package for WASM

func NewPackage

func NewPackage(name string) *Package

NewPackage initial a WASM package

func (*Package) Exit

func (pkg *Package) Exit(this js.Value, args []js.Value) interface{}

Exit the package

func (*Package) ExportFunction

func (pkg *Package) ExportFunction(name string, f jsFunction)

ExportFunction export the function to the global.{package name}.exports.{name}

func (*Package) ExportVar

func (pkg *Package) ExportVar(name string, variable js.Value)

ExportVar export the variable to global.{package name}.exports.{name}

func (*Package) Run

func (pkg *Package) Run()

Run the package

type ReturnObject

type ReturnObject struct {
	Success bool
	Return  interface{}
}

ReturnObject

func (*ReturnObject) Map

func (obj *ReturnObject) Map() map[string]interface{}

Map transfer ReturnObject to map[string]interface{} for returning to js

Jump to

Keyboard shortcuts

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