Documentation
¶
Index ¶
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type Runtime
- func (r *Runtime) CallFunction(source string, params ...interface{}) (otto.Value, error)
- func (r *Runtime) CallPromise(source string, params ...interface{}) (chan otto.Value, error)
- func (r *Runtime) CompleteKeywords(line string) []string
- func (r *Runtime) Do(fn func(*otto.Otto))
- func (r *Runtime) Exec(code string) (v otto.Value, err error)
- func (r *Runtime) ExecFunction(source string, params ...interface{}) (v otto.Value, err error)
- func (r *Runtime) ExecPromise(source string, params ...interface{}) (v otto.Value, err error)
- func (r *Runtime) RegisterAPIClient(client *shttp.CrudClient)
- func (r *Runtime) RunScript(path string) otto.Value
- func (r *Runtime) Start()
- func (r *Runtime) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type Runtime ¶
Runtime is a Skydive JavaScript runtime environment
func NewRuntime ¶
NewRuntime returns a new JavaScript runtime environment
func (*Runtime) CallFunction ¶
CallFunction takes the source of a function and evaluate it with the specified parameters
func (*Runtime) CallPromise ¶
CallPromise takes the source of a promise and evaluate it with the specified parameters
func (*Runtime) CompleteKeywords ¶
CompleteKeywords returns potential continuations for the given line. Since line is evaluated, callers need to make sure that evaluating line does not have side effects.
func (*Runtime) ExecFunction ¶
ExecFunction queues a CallFunction method
func (*Runtime) ExecPromise ¶
ExecPromise executes a promise and return its result
func (*Runtime) RegisterAPIClient ¶
func (r *Runtime) RegisterAPIClient(client *shttp.CrudClient)
RegisterAPIClient exports Go function required by the API to run inside the client JS VM