jasm

package
v0.0.0-...-9220275 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Rendered for js/wasm

Overview

Package jasm for async calls from JS Credits: https://github.com/brunoluiz/imagewand/blob/main/jasm/wasm.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayBuffer

func ArrayBuffer(data []byte) js.Value

ArrayBuffer returns an Array Buffer

func Await

func Await(cb func() (js.Value, error)) js.Value

Await creates a promise which allows any async code within the WASM program. Without that, IO/network operations will be a blocking request and will make the program go kaput.

func Error

func Error(err error) js.Value

Error returns a valid JS error

func HTTPResponse

func HTTPResponse(data []byte) js.Value

HTTPResponse returns a valid HTTP Response

func Uint8ArrayToBytes

func Uint8ArrayToBytes(input js.Value) []byte

Uint8ArrayToBytes converts an incoming JS Uint8Array into Golang bytes

Types

This section is empty.

Jump to

Keyboard shortcuts

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