dist

package
v0.0.0-...-b8e6cb6 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: MIT Imports: 9 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshall

func Marshall(message Message) ([]byte, error)

Types

type Body

type Body struct {
	RequestHeader RequestHeader
	RequestBody   RequestBody
	ReplyHeader   ReplyHeader
	ReplyBody     interface{}
}
type Header struct {
	Magic   string
	Version int
	Order   bool
	Type    int
	Size    int
}

type Invocation

type Invocation struct {
	ObjectId      int
	IpAddress     string
	PortNumber    int
	OperationName string
	Parameters    []interface{}
}

func NewInvocation

func NewInvocation(objectId int, ipAddress string, portNumber int, operationName string, parameters []interface{}) *Invocation

type Invoker

type Invoker interface {
	Register(objectId int, remoteObject interface{})
	Invoke(port int) (err error)
}

type InvokerImpl

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

func (*InvokerImpl) Invoke

func (inv *InvokerImpl) Invoke(port int, initialConnections int) (err error)

func (*InvokerImpl) Register

func (inv *InvokerImpl) Register(objectId int, remoteObject interface{})

type LookupProxy

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

func NewLookupProxy

func NewLookupProxy(host string, port int) *LookupProxy

func (LookupProxy) Bind

func (lp LookupProxy) Bind(sn string, cp common.ClientProxy) (err error)

func (LookupProxy) Close

func (lp LookupProxy) Close() error

func (LookupProxy) List

func (lp LookupProxy) List() (services []common.NamingRecord, err error)

func (LookupProxy) Lookup

func (lp LookupProxy) Lookup(serviceName string) (cp common.ClientProxy, err error)

type Message

type Message struct {
	Header Header
	Body   Body
}

func Unmarshall

func Unmarshall(marshaledMessage []byte) (message Message, err error)

type ReplyHeader

type ReplyHeader struct {
	ServiceContext string
	RequestId      int
	ReplyStatus    int
}

type RequestBody

type RequestBody struct {
	Parameters []interface{}
}

type RequestHeader

type RequestHeader struct {
	Context          string
	RequestId        int
	ResponseExpected bool
	ObjectKey        int
	Operation        string
}

type Requestor

type Requestor interface {
	Invoke(inv Invocation) (t Termination, err error)
	Close() error
}

type RequestorImpl

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

Implements requestor

func NewRequestorImpl

func NewRequestorImpl(ipAddress string, portNumber int) *RequestorImpl

func (*RequestorImpl) Close

func (r *RequestorImpl) Close() error

func (*RequestorImpl) Invoke

func (r *RequestorImpl) Invoke(inv Invocation) (t Termination, err error)

type Termination

type Termination struct {
	Result interface{}
}

Jump to

Keyboard shortcuts

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