v8host

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

The v8host packages provides functionality to execute client-side scripts in gost-dom. The engine uses v8, and requires cgo.

This engine is based on tommie's v8go form, which automatically pulls the latest v8 changes from the chromium repo.

An alternate script engine that is implemented in pure go is found in the gojahost package

See also: https://github.com/tommie/v8go

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIncompatibleType   = errors.New("Incompatible type")
	ErrWrongNoOfArguments = errors.New("Not enough arguments passed")
)

Functions

This section is empty.

Types

type V8ScriptContext

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

func (*V8ScriptContext) Clock added in v0.3.0

func (ctx *V8ScriptContext) Clock() html.Clock

func (*V8ScriptContext) Close

func (ctx *V8ScriptContext) Close()

func (*V8ScriptContext) Eval

func (ctx *V8ScriptContext) Eval(script string) (interface{}, error)

func (*V8ScriptContext) EvalCore

func (ctx *V8ScriptContext) EvalCore(script string) (any, error)

func (*V8ScriptContext) Export

func (ctx *V8ScriptContext) Export(val any) (any, error)

func (*V8ScriptContext) Run

func (ctx *V8ScriptContext) Run(script string) error

func (*V8ScriptContext) RunFunction

func (ctx *V8ScriptContext) RunFunction(script string, arguments ...any) (res any, err error)

type V8ScriptHost

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

func New

func New() *V8ScriptHost

func (*V8ScriptHost) Close

func (host *V8ScriptHost) Close()

func (*V8ScriptHost) NewContext

func (host *V8ScriptHost) NewContext(w html.Window) html.ScriptContext

Jump to

Keyboard shortcuts

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