executor

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2018 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Overview

Package executor provides an interface for executing compiled API programs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encodable

type Encodable interface {
	Encode([]byte) bool
}

type Env

type Env struct {
	// Globals is the buffer holding all the global fields.
	Globals []byte

	// Arena is the memory arena used by this execution environment.
	Arena arena.Arena
	// contains filtered or unexported fields
}

Env is the go execution environment.

func GetEnv

func GetEnv(c unsafe.Pointer) *Env

GetEnv returns the environment for the given context c.

func (*Env) Dispose

func (e *Env) Dispose()

Dispose releases the memory used by the environment. Call after the env is no longer needed to avoid leaking memory.

func (*Env) Execute

func (e *Env) Execute(ctx context.Context, cmd api.Cmd) error

Execute executes the command cmd.

func (*Env) GetBytes

func (e *Env) GetBytes(rng memory.Range) []byte

GetBytes returns the bytes that are in the given memory range.

type Executor

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

Executor is used to create execution environments for a compiled program. Use New() to create Executors, do not create directly.

func New

func New(prog *compiler.Program, optimize bool) *Executor

New returns a new and initialized Executor for the given program.

func (*Executor) NewEnv

func (e *Executor) NewEnv(ctx context.Context, capture *capture.Capture) *Env

NewEnv creates a new execution environment for the given capture.

Jump to

Keyboard shortcuts

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