v8local

package module
v0.0.0-...-c11a948 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Raw *v8go.Context
	// contains filtered or unexported fields
}

func NewContext

func NewContext(opt ...v8go.ContextOption) *Context

func (*Context) Close

func (c *Context) Close()

func (*Context) NewFunction

func (c *Context) NewFunction(callback FunctionCallback) *v8go.Value

func (*Context) NewFunctionTemplate

func (c *Context) NewFunctionTemplate(callback FunctionCallback) *FunctionTemplate

func (*Context) NewLocal

func (c *Context) NewLocal() *Local

func (*Context) RunIdleTasks

func (c *Context) RunIdleTasks(nowait bool, idleTimeInSeconds float64)

type FunctionCallback

type FunctionCallback func(info *FunctionCallbackInfo) *JsValue

type FunctionCallbackInfo

type FunctionCallbackInfo struct {
	// contains filtered or unexported fields
}

func NewFunctionCallbackInfo

func NewFunctionCallbackInfo(local *Local, this *JsValue, args ...*JsValue) *FunctionCallbackInfo

func (*FunctionCallbackInfo) Args

func (i *FunctionCallbackInfo) Args() []*JsValue

Args returns a slice of the value arguments that are passed to the JS function.

func (*FunctionCallbackInfo) GetArg

func (i *FunctionCallbackInfo) GetArg(idx int) *JsValue

func (*FunctionCallbackInfo) Local

func (i *FunctionCallbackInfo) Local() *Local

func (*FunctionCallbackInfo) This

func (i *FunctionCallbackInfo) This() *JsValue

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) *v8go.Value

func (*FunctionTemplate) GetLocalFunction

func (t *FunctionTemplate) GetLocalFunction(local *Local) *JsValue

type JsValue

type JsValue struct {
	// contains filtered or unexported fields
}

func (*JsValue) Array

func (v *JsValue) Array() []*JsValue

func (*JsValue) ArrayBufferContent

func (v *JsValue) ArrayBufferContent() []byte

func (*JsValue) AsExported

func (j *JsValue) AsExported() *JsValue

Mark the JsValue as exported and prevent it from being released automatically.

func (*JsValue) BigInt

func (v *JsValue) BigInt() *big.Int

func (*JsValue) Boolean

func (v *JsValue) Boolean() bool

func (*JsValue) Call

func (v *JsValue) Call(recvr *JsValue, args ...*JsValue) *JsValue

func (*JsValue) Delete

func (v *JsValue) Delete(key string) bool

func (*JsValue) DeleteIdx

func (v *JsValue) DeleteIdx(idx uint32) bool

func (*JsValue) Export

func (j *JsValue) Export() *v8go.Value

Export marks the JsValue as exported and returns the underlying *v8go.Value. You must release the returned *v8go.Value manually when you no longer need it.

func (*JsValue) Get

func (v *JsValue) Get(key string) *JsValue

func (*JsValue) GetIdx

func (v *JsValue) GetIdx(idx uint32) *JsValue

func (*JsValue) Has

func (v *JsValue) Has(key string) bool

func (*JsValue) HasIdx

func (v *JsValue) HasIdx(idx uint32) bool

func (*JsValue) Int32

func (v *JsValue) Int32() int32

func (*JsValue) Integer

func (v *JsValue) Integer() int64

func (*JsValue) IsArray

func (v *JsValue) IsArray() bool

func (*JsValue) IsArrayBuffer

func (v *JsValue) IsArrayBuffer() bool

func (*JsValue) IsBigInt

func (v *JsValue) IsBigInt() bool

func (*JsValue) IsBoolean

func (v *JsValue) IsBoolean() bool

func (*JsValue) IsDate

func (v *JsValue) IsDate() bool

func (*JsValue) IsFalse

func (v *JsValue) IsFalse() bool

func (*JsValue) IsFunction

func (v *JsValue) IsFunction() bool

func (*JsValue) IsInt32

func (v *JsValue) IsInt32() bool

func (*JsValue) IsMap

func (v *JsValue) IsMap() bool

func (*JsValue) IsNativeError

func (v *JsValue) IsNativeError() bool

func (*JsValue) IsNull

func (v *JsValue) IsNull() bool

func (*JsValue) IsNullOrUndefined

func (v *JsValue) IsNullOrUndefined() bool

func (*JsValue) IsNumber

func (v *JsValue) IsNumber() bool

func (*JsValue) IsObject

func (v *JsValue) IsObject() bool

func (*JsValue) IsRegExp

func (v *JsValue) IsRegExp() bool

func (*JsValue) IsSet

func (v *JsValue) IsSet() bool

func (*JsValue) IsTrue

func (v *JsValue) IsTrue() bool

func (*JsValue) IsUint32

func (v *JsValue) IsUint32() bool

func (*JsValue) IsUndefined

func (v *JsValue) IsUndefined() bool

func (*JsValue) Local

func (j *JsValue) Local() *Local

func (*JsValue) MethodCall

func (v *JsValue) MethodCall(methodName string, args ...*JsValue) *JsValue

func (*JsValue) MustMarshalJSON

func (v *JsValue) MustMarshalJSON() []byte

func (*JsValue) Number

func (v *JsValue) Number() float64

func (*JsValue) Release

func (j *JsValue) Release() bool

func (*JsValue) SameValue

func (v *JsValue) SameValue(other *JsValue) bool

func (*JsValue) Set

func (v *JsValue) Set(key string, val *JsValue)

func (*JsValue) SetIdx

func (v *JsValue) SetIdx(idx uint32, val *JsValue)

func (*JsValue) SetObjectMethod

func (v *JsValue) SetObjectMethod(name string, fn FunctionCallback)

func (*JsValue) String

func (v *JsValue) String() string

func (*JsValue) StringArrry

func (v *JsValue) StringArrry() []string

func (*JsValue) Uint32

func (v *JsValue) Uint32() uint32

type Local

type Local struct {
	// contains filtered or unexported fields
}

func (*Local) Close

func (l *Local) Close()

func (*Local) Context

func (l *Local) Context() *Context

func (*Local) Global

func (l *Local) Global() *JsValue

func (*Local) Import

func (l *Local) Import(v *v8go.Value) *JsValue

Import imports an existing *v8go.Value into the Local context. The imported value is marked as exported, so it won't be released when the Local context is closed.

func (*Local) NewArray

func (l *Local) NewArray(values ...*JsValue) *JsValue

func (*Local) NewArrayBuffer

func (l *Local) NewArrayBuffer(data []byte) *JsValue

func (*Local) NewBigInt

func (l *Local) NewBigInt(val *big.Int) *JsValue

func (*Local) NewBoolean

func (l *Local) NewBoolean(val bool) *JsValue

func (*Local) NewFunction

func (l *Local) NewFunction(callback FunctionCallback) *JsValue

func (*Local) NewInt32

func (l *Local) NewInt32(val int32) *JsValue

func (*Local) NewInt64

func (l *Local) NewInt64(val int64) *JsValue

func (*Local) NewLocal

func (l *Local) NewLocal() *Local

func (*Local) NewNumber

func (l *Local) NewNumber(val float64) *JsValue

func (*Local) NewObject

func (l *Local) NewObject() *JsValue

func (*Local) NewString

func (l *Local) NewString(val string) *JsValue

func (*Local) NewStringArray

func (l *Local) NewStringArray(values ...string) *JsValue

func (*Local) NullValue

func (l *Local) NullValue() *JsValue

func (*Local) RetainedValueCount

func (l *Local) RetainedValueCount() int

func (*Local) RunScript

func (l *Local) RunScript(script string, name string) *JsValue

Directories

Path Synopsis
plugins

Jump to

Keyboard shortcuts

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