v8client

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package v8client is a client for submitting jobs to the v8server. The purpose of this package and the v8server package is because embedding v8 into your Go binary takes too much time, so we instead communicate back with the embedded V8 in the bud binary during development. When building, we embed V8 directly because builds can afford to be slower.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client for evaluating scripts against the V8 server. This client may be used concurrently, but you cannot have multiple instances of clients communicating with the same server

func Launch

func Launch(ctx context.Context) (*Client, error)

Launch the process and return a client

func New

func New(reader io.Reader, writer io.Writer) *Client

New client for testing

func (*Client) Close

func (c *Client) Close() error

func (*Client) Eval

func (c *Client) Eval(path, expr string) (value string, err error)

func (*Client) Script

func (c *Client) Script(path, script string) error

type Input

type Input struct {
	Type string // "script" or "expr"
	Path string
	Code string
}

type Output

type Output struct {
	Result string
	Error  string
}

Jump to

Keyboard shortcuts

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