bridge

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FreeJsValues

func FreeJsValues(values []*v8go.Value)

FreeJsValues release js values

func GoValue

func GoValue(value *v8go.Value) (interface{}, error)

GoValue cast JavasScript value to Golang value

* JavaScript -> Golang * |-------------------------------------------------------- * | | JavaScript | Golang | * |-------------------------------------------------------- * | ✅ | null | nil | * | ✅ | undefined | bridge.Undefined | * | ✅ | boolean | bool | * | ✅ | number(int) | int | * | ✅ | number(float) | float64 | * | ✅ | bigint | int64 | * | ✅ | string | string | * | ✅ | object(Int8Array) | []byte | * | ✅ | object | map[string]interface{} | * | ✅ | array | []interface{} | * | ❌ | object(Promise) | bridge.Promise | * | ❌ | function | bridge.Function | * |-------------------------------------------------------

func GoValues

func GoValues(jsValues []*v8go.Value) ([]interface{}, error)

GoValues JavaScript -> Golang

func JsError

func JsError(ctx *v8go.Context, err interface{}) *v8go.Value

JsError return javascript error object

func JsException

func JsException(ctx *v8go.Context, message interface{}) *v8go.Value

JsException throw javascript Exception

func JsValue

func JsValue(ctx *v8go.Context, value interface{}) (*v8go.Value, error)

JsValue cast golang value to JavasScript value

* |------------------------------------------------------- * | | Golang | JavaScript | * |------------------------------------------------------- * | ✅ | nil | null | * | ✅ | bool | boolean | * | ✅ | int | number(int) | * | ✅ | uint | number(int) | * | ✅ | uint8 | number(int) | * | ✅ | uint16 | number(int) | * | ✅ | uint32 | number(int) | * | ✅ | int8 | number(int) | * | ✅ | int16 | number(int) | * | ✅ | int32 | number(int) | * | ✅ | float32 | number(float) | * | ✅ | float64 | number(float) | * | ✅ | int64 | bigint | * | ✅ | uint64 | bigint | * | ✅ | *big.Int | bigint | * | ✅ | string | string | * | ✅ | map[string]interface{} | object | * | ✅ | []interface{} | array | * | ✅ | []byte | object(Uint8Array) | * | ✅ | struct | object | * | ❌ | ?func | function | * |-------------------------------------------------------

func JsValues

func JsValues(ctx *v8go.Context, goValues []interface{}) ([]*v8go.Value, error)

JsValues Golang -> JavaScript

func ShareData

func ShareData(ctx *v8go.Context) (bool, map[string]interface{}, string, *v8go.Value)

ShareData get share data golang <-> javascript

func Valuers

func Valuers(values []*v8go.Value) []v8go.Valuer

Valuers to interface

Types

type UndefinedT

type UndefinedT byte

UndefinedT type of Undefined

var Undefined UndefinedT = 0x00

Undefined jsValue Undefined

Jump to

Keyboard shortcuts

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