Documentation ¶
Index ¶
- Variables
- func DisableAllocationStackTraces()
- func DumpTracer(ctx context.Context, w io.Writer, allocations bool)
- func EnableAllocationStackTraces()
- func Initialize()
- func StartTracer(t TracerType)
- func StopTracer(t TracerType)
- func TracerHandler() http.Handler
- func WithContext(ctx context.Context) context.Context
- type CallerInfo
- type Context
- func (c *Context) AddMicrotask(ctx context.Context, fn func(in FunctionArgs) error) error
- func (c *Context) Create(ctx context.Context, v interface{}) (*Value, error)
- func (c *Context) False(ctx context.Context) (*Value, error)
- func (c *Context) GetIsolate() *Isolate
- func (c *Context) Global(ctx context.Context) (*Value, error)
- func (c *Context) NewFunctionTemplate(ctx context.Context, cb Function) (*FunctionTemplate, error)
- func (c *Context) NewResolver(ctx context.Context) (*Resolver, error)
- func (c *Context) Null(ctx context.Context) (*Value, error)
- func (c *Context) ParseJSON(ctx context.Context, json string) (*Value, error)
- func (c *Context) Run(ctx context.Context, code string, filename string) (*Value, error)
- func (c *Context) True(ctx context.Context) (*Value, error)
- func (c *Context) Undefined(ctx context.Context) (*Value, error)
- type ExecutionContext
- type Function
- type FunctionArgs
- type FunctionTemplate
- func (f *FunctionTemplate) GetFunction(ctx context.Context) (*Value, error)
- func (f *FunctionTemplate) GetInstanceTemplate(ctx context.Context) (*ObjectTemplate, error)
- func (f *FunctionTemplate) GetPrototypeTemplate(ctx context.Context) (*ObjectTemplate, error)
- func (f *FunctionTemplate) Inherit(ctx context.Context, parent *FunctionTemplate) error
- func (f *FunctionTemplate) SetName(ctx context.Context, name string) error
- type Getter
- type GetterArgs
- type HeapStatistics
- type Inspector
- type InspectorCallbacks
- type Isolate
- func (i *Isolate) AddShutdownHook(shutdownHook interface{})
- func (i *Isolate) EnqueueMicrotaskWithValue(ctx context.Context, fn *Value) error
- func (i *Isolate) Enter(ctx context.Context)
- func (i *Isolate) Exit(ctx context.Context)
- func (i *Isolate) GetData(key string) interface{}
- func (i *Isolate) GetExecutionContext() *ExecutionContext
- func (i *Isolate) GetHeapStatistics(ctx context.Context) (HeapStatistics, error)
- func (i *Isolate) IsActive() bool
- func (i *Isolate) IsRunning(ctx context.Context) (bool, error)
- func (i *Isolate) NewContext(ctx context.Context) (*Context, error)
- func (i *Isolate) NewInspector(callbacks InspectorCallbacks) *Inspector
- func (i *Isolate) RequestGarbageCollectionForTesting(ctx context.Context)
- func (i *Isolate) RunMicrotasksInBackground()
- func (i *Isolate) RunMicrotasksSync(ctx context.Context) error
- func (i *Isolate) SendLowMemoryNotification(ctx context.Context)
- func (i *Isolate) SetData(key string, value interface{})
- func (i *Isolate) Sync(ctx context.Context, fn func(context.Context) (*Value, error)) (*Value, error)
- func (i *Isolate) Terminate()
- type Kind
- type Marshaler
- type ObjectTemplate
- type PromiseState
- type PropertyDescriptor
- type Resolver
- func (r *Resolver) Promise(ctx context.Context) (*Value, error)
- func (r *Resolver) Reject(ctx context.Context, value interface{}) error
- func (r *Resolver) RejectWithValue(ctx context.Context, v *Value) error
- func (r *Resolver) Resolve(ctx context.Context, value interface{}) error
- func (r *Resolver) ResolveWithValue(ctx context.Context, v *Value) error
- type Setter
- type SetterArgs
- type Snapshot
- type TracerType
- type Value
- func (v *Value) Bind(ctx context.Context, argv ...*Value) (*Value, error)
- func (v *Value) Bool(ctx context.Context) (bool, error)
- func (v *Value) Bytes(ctx context.Context) ([]byte, error)
- func (v *Value) Call(ctx context.Context, self *Value, argv ...*Value) (*Value, error)
- func (v *Value) CallMethod(ctx context.Context, name string, argv ...*Value) (*Value, error)
- func (v *Value) Date(ctx context.Context) (time.Time, error)
- func (v *Value) DefineProperty(ctx context.Context, key string, descriptor *PropertyDescriptor) error
- func (v *Value) Float64(ctx context.Context) (float64, error)
- func (v *Value) Get(ctx context.Context, key string) (*Value, error)
- func (v *Value) GetByteLength(ctx context.Context) (int, error)
- func (v *Value) GetContext() *Context
- func (v *Value) GetIndex(ctx context.Context, i int) (*Value, error)
- func (v *Value) GetInternalField(ctx context.Context, i int) (int64, error)
- func (v *Value) GetInternalFieldCount(ctx context.Context) (int, error)
- func (v *Value) Int64(ctx context.Context) (int64, error)
- func (v *Value) IsKind(k Kind) bool
- func (v *Value) MarshalJSON(ctx context.Context) ([]byte, error)
- func (v *Value) New(ctx context.Context, argv ...*Value) (*Value, error)
- func (v *Value) PromiseInfo(ctx context.Context) (PromiseState, *Value, error)
- func (v *Value) Receiver(ctx context.Context, t reflect.Type) (*reflect.Value, error)
- func (v *Value) Ref() refutils.ID
- func (v *Value) Set(ctx context.Context, key string, value *Value) error
- func (v *Value) SetBytes(ctx context.Context, bytes []byte) error
- func (v *Value) SetIndex(ctx context.Context, i int, value *Value) error
- func (v *Value) SetInternalField(ctx context.Context, i int, value uint32) error
- func (v *Value) SetReceiver(ctx context.Context, value *reflect.Value) error
- func (v *Value) String(ctx context.Context) (string, error)
- func (v *Value) Unmarshal(ctx context.Context, t reflect.Type) (*reflect.Value, error)
- func (v *Value) Unref()
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = struct{ Major, Minor, Build, Patch int }{ Major: int(C.version.major), Minor: int(C.version.minor), Build: int(C.version.build), Patch: int(C.version.patch), }
Version exposes the compiled-in version of the linked V8 library. This can be used to test for specific javascript functionality support (e.g. ES6 destructuring isn't supported before major version 5.).
Functions ¶
func DisableAllocationStackTraces ¶
func DisableAllocationStackTraces()
func EnableAllocationStackTraces ¶
func EnableAllocationStackTraces()
func Initialize ¶
func Initialize()
func StartTracer ¶
func StartTracer(t TracerType)
func StopTracer ¶
func StopTracer(t TracerType)
func TracerHandler ¶
Types ¶
type Context ¶
func (*Context) AddMicrotask ¶
func (*Context) GetIsolate ¶
func (*Context) NewFunctionTemplate ¶
type ExecutionContext ¶
func FromContext ¶
func FromContext(ctx context.Context) *ExecutionContext
func (*ExecutionContext) AddExecutionEnterCallback ¶
func (ec *ExecutionContext) AddExecutionEnterCallback(callback func())
func (*ExecutionContext) AddExecutionExitCallback ¶
func (ec *ExecutionContext) AddExecutionExitCallback(callback func())
func (*ExecutionContext) GetIsolate ¶
func (ec *ExecutionContext) GetIsolate() *Isolate
type Function ¶
type Function func(FunctionArgs) (*Value, error)
type FunctionArgs ¶
type FunctionTemplate ¶
func (*FunctionTemplate) GetFunction ¶
func (f *FunctionTemplate) GetFunction(ctx context.Context) (*Value, error)
func (*FunctionTemplate) GetInstanceTemplate ¶
func (f *FunctionTemplate) GetInstanceTemplate(ctx context.Context) (*ObjectTemplate, error)
func (*FunctionTemplate) GetPrototypeTemplate ¶
func (f *FunctionTemplate) GetPrototypeTemplate(ctx context.Context) (*ObjectTemplate, error)
func (*FunctionTemplate) Inherit ¶
func (f *FunctionTemplate) Inherit(ctx context.Context, parent *FunctionTemplate) error
type Getter ¶
type Getter func(GetterArgs) (*Value, error)
type GetterArgs ¶
type HeapStatistics ¶
type Inspector ¶
type Inspector struct {
// contains filtered or unexported fields
}
func (*Inspector) AddContext ¶
func (*Inspector) DispatchMessage ¶
func (*Inspector) RemoveContext ¶
type InspectorCallbacks ¶
type Isolate ¶
func NewIsolate ¶
func NewIsolate() *Isolate
func NewIsolateWithSnapshot ¶
func (*Isolate) AddShutdownHook ¶
func (i *Isolate) AddShutdownHook(shutdownHook interface{})
func (*Isolate) EnqueueMicrotaskWithValue ¶
func (*Isolate) GetExecutionContext ¶
func (i *Isolate) GetExecutionContext() *ExecutionContext
func (*Isolate) GetHeapStatistics ¶
func (i *Isolate) GetHeapStatistics(ctx context.Context) (HeapStatistics, error)
func (*Isolate) NewInspector ¶
func (i *Isolate) NewInspector(callbacks InspectorCallbacks) *Inspector
func (*Isolate) RequestGarbageCollectionForTesting ¶
func (*Isolate) RunMicrotasksInBackground ¶
func (i *Isolate) RunMicrotasksInBackground()
func (*Isolate) SendLowMemoryNotification ¶
type Kind ¶
type Kind uint8
Kind is an underlying V8 representation of a *Value. Javascript values may have multiple underyling kinds. For example, a function will be both KindObject and KindFunction.
const ( KindUndefined Kind = iota KindNull KindName KindString KindSymbol KindFunction KindArray KindObject KindBoolean KindNumber KindExternal KindInt32 KindUint32 KindDate KindArgumentsObject KindBooleanObject KindNumberObject KindStringObject KindSymbolObject KindNativeError KindRegExp KindAsyncFunction KindGeneratorFunction KindGeneratorObject KindPromise KindMap KindSet KindMapIterator KindSetIterator KindWeakMap KindWeakSet KindArrayBuffer KindArrayBufferView KindTypedArray KindUint8Array KindUint8ClampedArray KindInt8Array KindUint16Array KindInt16Array KindUint32Array KindInt32Array KindFloat32Array KindFloat64Array KindDataView KindProxy KindWebAssemblyCompiledModule )
type ObjectTemplate ¶
func (*ObjectTemplate) SetAccessor ¶
func (*ObjectTemplate) SetInternalFieldCount ¶
func (o *ObjectTemplate) SetInternalFieldCount(ctx context.Context, count int) error
type PromiseState ¶
type PromiseState uint8
PromiseState defines the state of a promise: either pending, resolved, or rejected. Promises that are pending have no result value yet. A promise that is resolved has a result value, and a promise that is rejected has a result value that is usually the error.
const ( PromiseStatePending PromiseState = iota PromiseStateResolved PromiseStateRejected )
func (PromiseState) String ¶
func (s PromiseState) String() string
type PropertyDescriptor ¶
type Resolver ¶
func (*Resolver) RejectWithValue ¶
type Setter ¶
type Setter func(SetterArgs) error
type SetterArgs ¶
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
func CreateSnapshot ¶
func ImportSnapshot ¶
type Value ¶
func (*Value) CallMethod ¶
func (*Value) DefineProperty ¶
func (*Value) GetContext ¶
func (*Value) GetInternalField ¶
func (*Value) GetInternalFieldCount ¶
func (*Value) PromiseInfo ¶
func (*Value) SetInternalField ¶
func (*Value) SetReceiver ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.