js

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DTS

func DTS() string

Types

type Runtime

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

Runtime is a wrapper for goja.Runtime.

func NewRuntime

func NewRuntime(ctx context.Context, log log.Logger, options ...RuntimeOption) (*Runtime, error)

NewRuntime creates new Runtime instance. Don't forget to close it after usage.

func (*Runtime) Close

func (r *Runtime) Close()

Close closes the runtime.

func (*Runtime) Events

func (r *Runtime) Events() <-chan events.Event

Events returns channel with events. Channel reading is required for the events working.

func (*Runtime) Interrupt

func (r *Runtime) Interrupt(reason string)

Interrupt interrupts the runtime.

func (*Runtime) RunScript

func (r *Runtime) RunScript(name, script string) error

RunScript runs the JS script.

type RuntimeOption

type RuntimeOption func(*Runtime)

RuntimeOption allows to set up some internal Runtime properties from outside.

func WithPrinter

func WithPrinter(p printer.Printer) RuntimeOption

WithPrinter sets up the printer for the runtime.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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