Loader

package
v0.0.0-...-3e87f45 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

* @Author: NyanCatda * @Date: 2022-03-26 18:48:29 * @LastEditTime: 2022-04-03 13:29:27 * @LastEditors: NyanCatda * @Description: 常见类型转换封装 * @FilePath: \Momizi\Internal\Plugin\JavaScriptV8\Tools\Loader\TypeConversion.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoArrayToV8Object

func GoArrayToV8Object[T []string | []int](Context *v8go.Context, Array T) (*v8go.Value, error)

*

  • @description: Go数组转V8对象(使用Json中转)
  • @param {*v8go.Context} Context V8上下文
  • @param {[]string|[]int} Array Go数组
  • @return {*}

func GoStructToV8Object

func GoStructToV8Object(Context *v8go.Context, Struct any) (*v8go.Value, error)

*

  • @description: Go结构体转换为V8JavaScript对象(使用Json中转)
  • @param {*v8go.Context} Context V8上下文
  • @param {any} Struct Go结构体
  • @return {*}

func V8ObjectToGoStringAnyMap

func V8ObjectToGoStringAnyMap(Context *v8go.Context, Object v8go.Valuer) (map[string]any, error)

*

  • @description: V8JavaScript对象转换为Go String Any Map(使用Json中转)
  • @param {*v8go.Context} Context V8上下文
  • @param {v8go.Valuer} Object V8JavaScript对象
  • @return {map[any]any} Map
  • @return {error} 错误

func V8ObjectToGoStringMap

func V8ObjectToGoStringMap(Context *v8go.Context, Object v8go.Valuer) (map[string]string, error)

*

  • @description: V8JavaScript对象转换为Go String Map(使用Json中转)
  • @param {*v8go.Context} Context V8上下文
  • @param {v8go.Valuer} Object V8JavaScript对象
  • @return {map[any]any} Map
  • @return {error} 错误

func V8StringArrayToGoStringArray

func V8StringArrayToGoStringArray(Array *v8go.Value) ([]string, error)

*

  • @description: V8JavaScript String数组转换为Go String数组
  • @param {*v8go.Context} Context V8上下文
  • @param {*v8go.Value} Array String数组
  • @return {*}

Types

This section is empty.

Jump to

Keyboard shortcuts

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