Documentation ¶
Overview ¶
Package goplugin - golang plugin in docker runner
Index ¶
- type GoPlugin
- func (gp *GoPlugin) CallConstructor(ctx *core.LogicCallContext, code core.RecordRef, name string, ...) ([]byte, error)
- func (gp *GoPlugin) CallMethod(ctx *core.LogicCallContext, code core.RecordRef, data []byte, method string, ...) ([]byte, core.Arguments, error)
- func (gp *GoPlugin) Downstream() (*rpc.Client, error)
- func (gp *GoPlugin) Start()
- func (gp *GoPlugin) StartRunner() error
- func (gp *GoPlugin) Stop() error
- type Options
- type RPC
- func (gpr *RPC) GetCode(req rpctypes.UpGetCodeReq, reply *rpctypes.UpGetCodeResp) error
- func (gpr *RPC) GetDelegate(req rpctypes.UpGetDelegateReq, reply *rpctypes.UpGetDelegateResp) error
- func (gpr *RPC) GetObjChildren(req rpctypes.UpGetObjChildrenReq, reply *rpctypes.UpGetObjChildrenResp) error
- func (gpr *RPC) RouteCall(req rpctypes.UpRouteReq, reply *rpctypes.UpRouteResp) error
- func (gpr *RPC) RouteConstructorCall(req rpctypes.UpRouteConstructorReq, reply *rpctypes.UpRouteConstructorResp) error
- func (gpr *RPC) SaveAsChild(req rpctypes.UpSaveAsChildReq, reply *rpctypes.UpSaveAsChildResp) error
- func (gpr *RPC) SaveAsDelegate(req rpctypes.UpSaveAsDelegateReq, reply *rpctypes.UpSaveAsDelegateResp) error
- type RunnerOptions
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 ArtifactManager core.ArtifactManager // 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, am core.ArtifactManager) (*GoPlugin, error)
NewGoPlugin returns a new started GoPlugin
func (*GoPlugin) CallConstructor ¶ added in v0.0.5
func (gp *GoPlugin) CallConstructor(ctx *core.LogicCallContext, code 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(ctx *core.LogicCallContext, code 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
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
StartRunner starts ginsider process
type Options ¶
type Options struct { // Listen is address `GoPlugin` listens on and provides RPC interface for runner(s) Listen 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) GetCode ¶ added in v0.0.6
func (gpr *RPC) GetCode(req rpctypes.UpGetCodeReq, reply *rpctypes.UpGetCodeResp) error
GetCode is an RPC retrieving a code by its reference
func (*RPC) GetDelegate ¶ added in v0.2.0
func (gpr *RPC) GetDelegate(req rpctypes.UpGetDelegateReq, reply *rpctypes.UpGetDelegateResp) error
GetDelegate is an RPC saving data as memory of a contract as child a parent
func (*RPC) GetObjChildren ¶ added in v0.2.0
func (gpr *RPC) GetObjChildren(req rpctypes.UpGetObjChildrenReq, reply *rpctypes.UpGetObjChildrenResp) error
GetObjChildren is an RPC returns set of object children
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
func (*RPC) SaveAsChild ¶ added in v0.0.6
func (gpr *RPC) SaveAsChild(req rpctypes.UpSaveAsChildReq, reply *rpctypes.UpSaveAsChildResp) error
SaveAsChild is an RPC saving data as memory of a contract as child a parent
func (*RPC) SaveAsDelegate ¶ added in v0.0.6
func (gpr *RPC) SaveAsDelegate(req rpctypes.UpSaveAsDelegateReq, reply *rpctypes.UpSaveAsDelegateResp) error
SaveAsDelegate is an RPC saving data as memory of a contract as child a parent
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 |