Documentation
¶
Index ¶
- func ExportRawValue(v *JsValue, noRelease bool) *v8go.Value
- type Consumed
- type Context
- func (c *Context) Close()
- func (c *Context) Global() *JsValue
- func (c *Context) NewArray(values ...*Consumed) *JsValue
- func (c *Context) NewArrayBuffer(data []byte) *JsValue
- func (c *Context) NewBigInt(val *big.Int) *JsValue
- func (c *Context) NewBoolean(val bool) *JsValue
- func (c *Context) NewFunction(callback FunctionCallback) *JsValue
- func (c *Context) NewFunctionTemplate(callback FunctionCallback) *FunctionTemplate
- func (c *Context) NewInt32(val int32) *JsValue
- func (c *Context) NewInt64(val int64) *JsValue
- func (c *Context) NewNumber(val float64) *JsValue
- func (c *Context) NewObject() *JsValue
- func (c *Context) NewString(val string) *JsValue
- func (c *Context) NewStringArray(values ...string) *JsValue
- func (c *Context) NullValue() *JsValue
- func (c *Context) RunScript(script string, name string) *JsValue
- func (c *Context) Wrap(v *v8go.Value) *JsValue
- type FunctionCallback
- type FunctionCallbackInfo
- type FunctionTemplate
- type JsValue
- func (v *JsValue) Array() []*JsValue
- func (v *JsValue) ArrayBufferContent() []byte
- func (v *JsValue) BigInt() *big.Int
- func (v *JsValue) Boolean() bool
- func (v *JsValue) Call(recvr *JsValue, args ...*Consumed) *JsValue
- func (v *JsValue) Consume() *Consumed
- func (v *JsValue) ConsumeReuseble() *Reusable
- func (v *JsValue) Delete(key string) bool
- func (v *JsValue) DeleteIdx(idx uint32) bool
- func (v *JsValue) Get(key string) *JsValue
- func (v *JsValue) GetIdx(idx uint32) *JsValue
- func (v *JsValue) Has(key string) bool
- func (v *JsValue) HasIdx(idx uint32) bool
- func (v *JsValue) Int32() int32
- func (v *JsValue) Integer() int64
- func (v *JsValue) IsArray() bool
- func (v *JsValue) IsArrayBuffer() bool
- func (v *JsValue) IsBigInt() bool
- func (v *JsValue) IsBoolean() bool
- func (v *JsValue) IsDate() bool
- func (v *JsValue) IsFalse() bool
- func (v *JsValue) IsFunction() bool
- func (v *JsValue) IsInt32() bool
- func (v *JsValue) IsMap() bool
- func (v *JsValue) IsNativeError() bool
- func (v *JsValue) IsNull() bool
- func (v *JsValue) IsNullOrUndefined() bool
- func (v *JsValue) IsNumber() bool
- func (v *JsValue) IsObject() bool
- func (v *JsValue) IsRegExp() bool
- func (v *JsValue) IsSet() bool
- func (v *JsValue) IsTrue() bool
- func (v *JsValue) IsUint32() bool
- func (v *JsValue) IsUndefined() bool
- func (v *JsValue) MethodCall(methodName string, args ...*Consumed) *JsValue
- func (v *JsValue) MustMarshalJSON() []byte
- func (v *JsValue) Number() float64
- func (v *JsValue) Release()
- func (v *JsValue) SameValue(other *JsValue) bool
- func (v *JsValue) Set(key string, val *Consumed)
- func (v *JsValue) SetIdx(idx uint32, val *Consumed)
- func (v *JsValue) SetObjectMethod(ctx *Context, name string, fn FunctionCallback)
- func (v *JsValue) String() string
- func (v *JsValue) StringArrry() []string
- func (v *JsValue) Uint32() uint32
- type Reusable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Consumed ¶
type Consumed struct {
*JsValue
// contains filtered or unexported fields
}
Consumed Should be used to wrap a JsValue that is consumed by a function call. You should not use JsValue directly after calling a function that consumes it.
type Context ¶
func NewContext ¶
func NewContext(opt ...v8go.ContextOption) *Context
func (*Context) NewArrayBuffer ¶
func (*Context) NewBoolean ¶
func (*Context) NewFunction ¶
func (c *Context) NewFunction(callback FunctionCallback) *JsValue
func (*Context) NewFunctionTemplate ¶
func (c *Context) NewFunctionTemplate(callback FunctionCallback) *FunctionTemplate
func (*Context) NewStringArray ¶
type FunctionCallback ¶
type FunctionCallback func(info *FunctionCallbackInfo) *Consumed
type FunctionCallbackInfo ¶
type FunctionCallbackInfo struct {
// contains filtered or unexported fields
}
func NewFunctionCallbackInfo ¶
func NewFunctionCallbackInfo(ctx *Context, this *Consumed, args ...*Consumed) *FunctionCallbackInfo
func (*FunctionCallbackInfo) Args ¶
func (i *FunctionCallbackInfo) Args() []*Consumed
Args returns a slice of the value arguments that are passed to the JS function.
func (*FunctionCallbackInfo) Context ¶
func (i *FunctionCallbackInfo) Context() *Context
func (*FunctionCallbackInfo) GetArg ¶
func (i *FunctionCallbackInfo) GetArg(idx int) *Consumed
func (*FunctionCallbackInfo) This ¶
func (i *FunctionCallbackInfo) This() *Consumed
This returns the receiver object "this".
type FunctionTemplate ¶
type FunctionTemplate struct {
// contains filtered or unexported fields
}
func (*FunctionTemplate) GetFunction ¶
func (t *FunctionTemplate) GetFunction(ctx *Context) *JsValue
type JsValue ¶
type JsValue struct {
// contains filtered or unexported fields
}
JsValue is a wrapper for v8go.Value
YOU MUST CALL Release() ON CONSUMED METHOD WHEN YOU FINISH USING IT.
OR YOU CAN CALL CONSUM() METHOD TO GET A CONSUMED VALUE AND PASS IT TO FUNCTION CALL.
func (*JsValue) ArrayBufferContent ¶
func (*JsValue) ConsumeReuseble ¶
Reuse returns a reusable value that can be used to avoid unnecessary allocations. You should call Dispoe() or FinalConsume() on the returned value when you finish using it. You should not call Consume() on JsValue if you call ConsumeReuseble() on it.
func (*JsValue) IsArrayBuffer ¶
func (*JsValue) IsFunction ¶
func (*JsValue) IsNativeError ¶
func (*JsValue) IsNullOrUndefined ¶
func (*JsValue) IsUndefined ¶
func (*JsValue) MethodCall ¶
func (*JsValue) MustMarshalJSON ¶
func (*JsValue) SetObjectMethod ¶
func (v *JsValue) SetObjectMethod(ctx *Context, name string, fn FunctionCallback)