goplugin

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2018 License: Apache-2.0 Imports: 12 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 {
	Cfg           configuration.Goplugin
	MessageRouter core.MessageRouter
	// contains filtered or unexported fields
}

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

func NewGoPlugin

func NewGoPlugin(conf configuration.Goplugin, mr core.MessageRouter) (*GoPlugin, error)

NewGoPlugin returns a new started GoPlugin

func (*GoPlugin) CallConstructor added in v0.0.5

func (gp *GoPlugin) CallConstructor(codeRef core.RecordRef, name string, args core.Arguments) ([]byte, error)

CallConstructor runs a constructor of a contract in controlled environment

func (*GoPlugin) CallMethod added in v0.0.5

func (gp *GoPlugin) CallMethod(codeRef core.RecordRef, data []byte, method string, args core.Arguments) ([]byte, core.Arguments, error)

CallMethod runs a method on an object in controlled environment

func (*GoPlugin) Downstream added in v0.0.5

func (gp *GoPlugin) Downstream() (*rpc.Client, error)

Downstream returns a connection to `ginsider`

func (*GoPlugin) Start

func (gp *GoPlugin) Start()

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

func (*GoPlugin) StartRunner added in v0.0.4

func (gp *GoPlugin) StartRunner() error

StartRunner starts ginsider process

func (*GoPlugin) Stop

func (gp *GoPlugin) Stop() error

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 various tasks, e.g. code fetching

func (*RPC) GetObject

func (gpr *RPC) GetObject(ref core.RecordRef, reply *rpctypes.Object) error

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

func (*RPC) RouteCall added in v0.0.4

func (gpr *RPC) RouteCall(req rpctypes.UpRouteReq, reply *rpctypes.UpRouteResp) error

RouteCall routes call from a contract to a contract through message router

func (*RPC) RouteConstructorCall added in v0.0.5

func (gpr *RPC) RouteConstructorCall(req rpctypes.UpRouteConstructorReq, reply *rpctypes.UpRouteConstructorResp) error

RouteConstructorCall routes call from a contract to a constructor of another contract

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
Package foundation server implementation of smartcontract functions
Package foundation server implementation of smartcontract functions
testplugins

Jump to

Keyboard shortcuts

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