ginsider

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeUpBaseReq added in v0.4.0

func MakeUpBaseReq() rpctypes.UpBaseReq

MakeUpBaseReq makes base of request from current CallContext

Types

type GoInsider

type GoInsider struct {
	UpstreamClient *rpc.Client
	// contains filtered or unexported fields
}

GoInsider is an RPC interface to run code of plugins

func NewGoInsider

func NewGoInsider(path, network, address string) *GoInsider

NewGoInsider creates a new GoInsider instance validating arguments

func (*GoInsider) AddPlugin added in v0.6.3

func (gi *GoInsider) AddPlugin(ref core.RecordRef, path string) error

AddPlugin inject plugin by ref in gi memory

func (*GoInsider) DeactivateObject added in v0.6.0

func (gi *GoInsider) DeactivateObject(object core.RecordRef) error

DeactivateObject ...

func (*GoInsider) Deserialize

func (gi *GoInsider) Deserialize(from []byte, into interface{}) error

Deserialize - CBOR de-serializer wrapper: `from` -> `into`

func (*GoInsider) GetDelegate added in v0.2.0

func (gi *GoInsider) GetDelegate(object, ofType core.RecordRef) (core.RecordRef, error)

GetDelegate ...

func (*GoInsider) GetObjChildrenIterator added in v0.7.5

func (gi *GoInsider) GetObjChildrenIterator(obj core.RecordRef, prototype core.RecordRef, iteratorID string) (*proxyctx.ChildrenTypedIterator, error)

GetObjChildrenIterator rpc call to insolard service, returns iterator over children of object with specified prototype at first time call it without iteratorID iteratorID is a cache key on service side, use it in all calls, except first

func (*GoInsider) MakeErrorSerializable added in v0.4.0

func (gi *GoInsider) MakeErrorSerializable(e error) error

MakeErrorSerializable converts errors satisfying error interface to foundation.Error

func (*GoInsider) ObtainCode

func (gi *GoInsider) ObtainCode(ctx context.Context, ref core.RecordRef) (string, error)

ObtainCode returns path on the file system to the plugin, fetches it from a provider if it's not in the storage

func (*GoInsider) Plugin added in v0.0.5

func (gi *GoInsider) Plugin(ctx context.Context, ref core.RecordRef) (*plugin.Plugin, error)

Plugin loads Go plugin by reference and returns `*plugin.Plugin` ready to lookup symbols

func (*GoInsider) RouteCall

func (gi *GoInsider) RouteCall(ref core.RecordRef, wait bool, method string, args []byte, proxyPrototype core.RecordRef) ([]byte, error)

RouteCall ...

func (*GoInsider) SaveAsChild added in v0.0.6

func (gi *GoInsider) SaveAsChild(parentRef, classRef core.RecordRef, constructorName string, argsSerialized []byte) (core.RecordRef, error)

SaveAsChild ...

func (*GoInsider) SaveAsDelegate added in v0.0.6

func (gi *GoInsider) SaveAsDelegate(intoRef, classRef core.RecordRef, constructorName string, argsSerialized []byte) (core.RecordRef, error)

SaveAsDelegate ...

func (*GoInsider) Serialize

func (gi *GoInsider) Serialize(what interface{}, to *[]byte) error

Serialize - CBOR serializer wrapper: `what` -> `to`

func (*GoInsider) Upstream

func (gi *GoInsider) Upstream() (*rpc.Client, error)

Upstream returns RPC client connected to upstream server (goplugin)

type RPC

type RPC struct {
	GI *GoInsider
}

RPC struct with methods representing RPC interface of this code runner

func (*RPC) CallConstructor added in v0.0.5

func (t *RPC) CallConstructor(args rpctypes.DownCallConstructorReq, reply *rpctypes.DownCallConstructorResp) (err error)

CallConstructor is an RPC that runs a method on an object and returns a new state of the object and result of the method

func (*RPC) CallMethod added in v0.0.5

func (t *RPC) CallMethod(args rpctypes.DownCallMethodReq, reply *rpctypes.DownCallMethodResp) (err error)

CallMethod is an RPC that runs a method on an object and returns a new state of the object and result of the method

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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