quickjsWrap

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoObjectToJsValue

func GoObjectToJsValue(goValue interface{}, ctx *quickjs.Context) quickjs.Value

func JsValueToGoObject

func JsValueToGoObject(expectArgumentType reflect.Type, jsValue quickjs.Value) (interface{}, error)

func WrapClass

func WrapClass(class *quickjs.JSClass, classConstructorOptFn ConstructorOpt, opts ...ClassOpt) *quickjs.JSClass

func WrapFn

func WrapFn(goFn interface{}) func(ctx *quickjs.Context, this quickjs.Value, args []quickjs.Value) quickjs.Value

Types

type ClassOpt

type ClassOpt func(*classOpts)

func WithExportFieldBindList

func WithExportFieldBindList(fieldBindMap map[string]string) ClassOpt

func WithExportMethodBindList

func WithExportMethodBindList(methodBindMap map[string]string) ClassOpt

func WithFinalizer

func WithFinalizer(finalizer func(obj interface{})) ClassOpt

func WithSetCheckInArgCount

func WithSetCheckInArgCount() ClassOpt

type ConstructorOpt

type ConstructorOpt func(opts *classConstructorOpts)

func WithBindConstructorFn

func WithBindConstructorFn(constructorFn interface{}) ConstructorOpt

func WithQjsConstructorFn

func WithQjsConstructorFn(constructorFn interface{}) ConstructorOpt

Jump to

Keyboard shortcuts

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