javascript

package
v0.0.0-...-49b5ceb Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package javascript provides a runtime wrapper for executing JavaScript in Go.

This exposes a simple runtime that can be used for executing JavaScript prgorams.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runtime

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

func NewRuntime

func NewRuntime() *Runtime

NewRuntime returns a new Runtime. Access the vm via the VM() accessor.

func (*Runtime) Run

func (rt *Runtime) Run(src interface{}) (ret otto.Value, err error)

Run will execute the given JavaScript, continuing to run until all timers have finished executing (if any). The following functions are included in the js vm:

clearInterval
clearTimeout
setInterval
setTimeout

func (*Runtime) VM

func (rt *Runtime) VM() *otto.Otto

VM is an accessor for the js vm.

Directories

Path Synopsis
Package libk8s provides a JavaScript library for Kubernetes.
Package libk8s provides a JavaScript library for Kubernetes.
Package module implements a Node.js-like modular system for Go/Otto Bind this module to the Otto runtime and then within JavaScript a require stanza can be used.
Package module implements a Node.js-like modular system for Go/Otto Bind this module to the Otto runtime and then within JavaScript a require stanza can be used.

Jump to

Keyboard shortcuts

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