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 ¶
- Variables
- type V8ScriptContext
- func (ctx *V8ScriptContext) Clock() html.Clock
- func (ctx *V8ScriptContext) Close()
- func (ctx *V8ScriptContext) Eval(script string) (interface{}, error)
- func (ctx *V8ScriptContext) EvalCore(script string) (any, error)
- func (ctx *V8ScriptContext) Export(val any) (any, error)
- func (ctx *V8ScriptContext) Run(script string) error
- func (ctx *V8ScriptContext) RunFunction(script string, arguments ...any) (res any, err error)
- type V8ScriptHost
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) 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
Source Files
¶
- argument_helper.go
- custom_event.go
- document.go
- document_fragment.go
- dom.go
- dom_parser.go
- dom_token_list_generated.go
- element.go
- element_generated.go
- es_wrapper.go
- event.go
- event_generated.go
- event_loop.go
- event_target.go
- form_data.go
- history.go
- history_generated.go
- html_anchor_element_generated.go
- html_document.go
- html_element_generated.go
- html_form_element_generated.go
- html_hyperlink_element_utils_generated.go
- html_input_element_generated.go
- html_or_svgelement.go
- html_or_svgelement_generated.go
- html_template_element_generated.go
- iterator.go
- location.go
- named_node_map.go
- node.go
- node_generated.go
- node_list.go
- package.go
- parent_node.go
- parent_node_generated.go
- pointerevents4_generated.go
- polyfills.go
- script_host.go
- shadow_root.go
- template_builder.go
- uievents.go
- uievents_generated.go
- url.go
- url_generated.go
- window.go
- window_generated.go
- xhr_generated.go
- xml_http_request.go
Click to show internal directories.
Click to hide internal directories.