goplugin

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package goplugin - golang plugin in docker runner

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoPlugin

type GoPlugin struct {
	Options       Options
	RunnerOptions RunnerOptions
	// contains filtered or unexported fields
}

GoPlugin is a logic runner of code written in golang and compiled as go plugins

func NewGoPlugin

func NewGoPlugin(options Options, runnerOptions RunnerOptions) (*GoPlugin, error)

NewGoPlugin returns a new started GoPlugin

func (*GoPlugin) Exec

func (gp *GoPlugin) Exec(object logicrunner.Object, method string, args logicrunner.Arguments) ([]byte, logicrunner.Arguments, error)

Exec runs a method on an object in controlled environment

func (*GoPlugin) Start

func (gp *GoPlugin) Start()

Start starts runner and RPC interface to help runner, note that NewGoPlugin does this for you

func (*GoPlugin) Stop

func (gp *GoPlugin) Stop()

Stop stops runner(s) and RPC service

type Options

type Options struct {
	// Listen  is address `GoPlugin` listens on and provides RPC interface for runner(s)
	Listen string
	// CodePath is path to directory with plugin's code, this should go away at some point
	CodePath string
}

Options of the GoPlugin

type RPC

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

RPC is a RPC interface for runner to use for variouse tasks, e.g. code fetching

func (*RPC) GetObject

func (gpr *RPC) GetObject(ref logicrunner.Reference, reply *logicrunner.Object) error

GetObject is an RPC retriving an object by its reference, so far short circueted to return code of the plugin

type RunnerOptions

type RunnerOptions struct {
	// Listen is address the runner listens on and provides RPC interface for the `GoPlugin`
	Listen string
	// CodeStoragePath is path to directory where the runner caches code
	CodeStoragePath string
}

RunnerOptions - set of options to control internal isolated code runner(s)

Directories

Path Synopsis
testplugins
foundation
Package foundation emulates foundation of types for golang contracts
Package foundation emulates foundation of types for golang contracts

Jump to

Keyboard shortcuts

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