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 ¶
- func GoArrayToV8Object[T []string | []int](Context *v8go.Context, Array T) (*v8go.Value, error)
- func GoStructToV8Object(Context *v8go.Context, Struct any) (*v8go.Value, error)
- func V8ObjectToGoStringAnyMap(Context *v8go.Context, Object v8go.Valuer) (map[string]any, error)
- func V8ObjectToGoStringMap(Context *v8go.Context, Object v8go.Valuer) (map[string]string, error)
- func V8StringArrayToGoStringArray(Array *v8go.Value) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GoArrayToV8Object ¶
*
- @description: Go数组转V8对象(使用Json中转)
- @param {*v8go.Context} Context V8上下文
- @param {[]string|[]int} Array Go数组
- @return {*}
func GoStructToV8Object ¶
*
- @description: Go结构体转换为V8JavaScript对象(使用Json中转)
- @param {*v8go.Context} Context V8上下文
- @param {any} Struct Go结构体
- @return {*}
func V8ObjectToGoStringAnyMap ¶
*
- @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 ¶
*
- @description: V8JavaScript对象转换为Go String Map(使用Json中转)
- @param {*v8go.Context} Context V8上下文
- @param {v8go.Valuer} Object V8JavaScript对象
- @return {map[any]any} Map
- @return {error} 错误
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.