Documentation
¶
Overview ¶
Package bind Energy has not been exported or added yet
Index ¶
- func GetBinds(fn func(bind *V8bind))
- type BindType
- type Data
- type JSArray
- type JSBoolean
- type JSDouble
- type JSFunction
- type JSInteger
- type JSObject
- type JSString
- type JSUndefined
- type JSValue
- type V8Value
- func (m *V8Value) AsBoolean() JSBoolean
- func (m *V8Value) AsDouble() JSDouble
- func (m *V8Value) AsFunction() JSFunction
- func (m *V8Value) AsInteger() JSInteger
- func (m *V8Value) AsString() JSString
- func (m *V8Value) AsUndefined() JSUndefined
- func (m *V8Value) AsV8Value() JSValue
- func (m *V8Value) BindType() BindType
- func (m *V8Value) BooleanValue() bool
- func (m *V8Value) DoubleValue() float64
- func (m *V8Value) Id() int
- func (m *V8Value) IntegerValue() int
- func (m *V8Value) Invoke(argumentList json.JSONArray) (resultArgument json.JSONArray)
- func (m *V8Value) IsArray() bool
- func (m *V8Value) IsBoolean() bool
- func (m *V8Value) IsDouble() bool
- func (m *V8Value) IsFunction() bool
- func (m *V8Value) IsInteger() bool
- func (m *V8Value) IsObject() bool
- func (m *V8Value) IsString() bool
- func (m *V8Value) IsUndefined() bool
- func (m *V8Value) JSON() json.JSON
- func (m *V8Value) Name() string
- func (m *V8Value) SetValue(value any)
- func (m *V8Value) StringValue() string
- func (m *V8Value) Type() reflect.Kind
- func (m *V8Value) UndefinedValue() string
- func (m *V8Value) Value() any
- type V8bind
- func (m *V8bind) Add(value JSValue) uintptr
- func (m *V8bind) ElementToJSValue(item *list.Element) JSValue
- func (m *V8bind) FieldCollection() *list.List
- func (m *V8bind) Get(id uintptr) *list.Element
- func (m *V8bind) GetJSValue(id uintptr) JSValue
- func (m *V8bind) HasFieldCollection() map[string]uintptr
- func (m *V8bind) HasSize() int
- func (m *V8bind) Remove(id uintptr) any
- func (m *V8bind) Set(value JSValue)
- func (m *V8bind) Size() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BindType ¶
type BindType int8
BindType 绑定值类型
动态类型是可变类型, NewDynamic创建绑定变量, 函数传值方式 静态类型是不可变类型, NewStatic创建绑定变量, 直接传入变量指针, 非 interface{} 类型
type JSArray ¶
type JSFunction ¶
type JSObject ¶
type JSUndefined ¶
type JSUndefined interface { JSValue AsUndefined() JSUndefined UndefinedValue() string }
type JSValue ¶
type JSValue interface { Name() string //当前变量绑定的名称 JSON() json.JSON // Value() any // SetValue(value any) //设置新值 IsInteger() bool //是否 Integer IsDouble() bool //是否 Double IsString() bool //是否 String IsBoolean() bool //是否 Boolean IsObject() bool //是否 Object IsArray() bool //是否 Array IsUndefined() bool //是否 Undefined IsFunction() bool //是否 Function AsInteger() JSInteger //转换为 Integer 失败返回 nil AsDouble() JSDouble //转换为 Double 失败返回 nil AsString() JSString //转换为 String 失败返回 nil AsBoolean() JSBoolean //转换为 Boolean 失败返回 nil AsUndefined() JSUndefined //转换为 Undefined 失败返回 nil AsFunction() JSFunction //转换为 Function 失败返回 nil AsV8Value() JSValue //转换为 JSValue StringValue() string BooleanValue() bool DoubleValue() float64 IntegerValue() int UndefinedValue() string // Invoke 调用函数 // 入参: 以参数列表形式传入参数 // 入参如果参数类型或数量不匹配这些参数将以类型的默认值传入 // nil 无入参 // 出参: 以参数列表形式返回参数 // 无返回值返回nil Invoke(argumentList json.JSONArray) (resultArgument json.JSONArray) Id() int //指针ID Type() reflect.Kind //值类型 BindType() BindType //绑定类型 // contains filtered or unexported methods }
JSValue
GO和JS动态变量类型 ¶
在主进程有效
type V8Value ¶
V8Value 绑定到JS的字段
func (*V8Value) AsFunction ¶
func (m *V8Value) AsFunction() JSFunction
func (*V8Value) AsUndefined ¶
func (m *V8Value) AsUndefined() JSUndefined
func (*V8Value) BooleanValue ¶
func (*V8Value) DoubleValue ¶
func (*V8Value) IntegerValue ¶
func (*V8Value) IsFunction ¶
func (*V8Value) IsUndefined ¶
func (*V8Value) StringValue ¶
func (*V8Value) UndefinedValue ¶
type V8bind ¶
type V8bind struct {
// contains filtered or unexported fields
}
V8bind
func (*V8bind) FieldCollection ¶
func (*V8bind) HasFieldCollection ¶
Click to show internal directories.
Click to hide internal directories.