protocol

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseExporter

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

func NewBaseExporter

func NewBaseExporter(key string, invoker Invoker, exporterMap *sync.Map) *BaseExporter

func (*BaseExporter) GetInvoker

func (de *BaseExporter) GetInvoker() Invoker

func (*BaseExporter) Unexport

func (de *BaseExporter) Unexport()

type BaseInvoker

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

func NewBaseInvoker

func NewBaseInvoker(url common.URL) *BaseInvoker

func (*BaseInvoker) Destroy

func (bi *BaseInvoker) Destroy()

func (*BaseInvoker) GetUrl

func (bi *BaseInvoker) GetUrl() common.URL

func (*BaseInvoker) Invoke

func (bi *BaseInvoker) Invoke(invocation Invocation) Result

func (*BaseInvoker) IsAvailable

func (bi *BaseInvoker) IsAvailable() bool

func (*BaseInvoker) IsDestroyed

func (bi *BaseInvoker) IsDestroyed() bool

type BaseProtocol

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

func NewBaseProtocol

func NewBaseProtocol() BaseProtocol

func (*BaseProtocol) Destroy

func (bp *BaseProtocol) Destroy()

Destroy will destroy all invoker and exporter, so it only is called once.

func (*BaseProtocol) Export

func (bp *BaseProtocol) Export(invoker Invoker) Exporter

func (*BaseProtocol) ExporterMap

func (bp *BaseProtocol) ExporterMap() *sync.Map

func (*BaseProtocol) Invokers

func (bp *BaseProtocol) Invokers() []Invoker

func (*BaseProtocol) Refer

func (bp *BaseProtocol) Refer(url common.URL) Invoker

func (*BaseProtocol) SetExporterMap

func (bp *BaseProtocol) SetExporterMap(key string, exporter Exporter)

func (*BaseProtocol) SetInvokers

func (bp *BaseProtocol) SetInvokers(invoker Invoker)

type Exporter

type Exporter interface {
	GetInvoker() Invoker
	Unexport()
}

wrapping invoker

type Invocation

type Invocation interface {
	MethodName() string
	ParameterTypes() []reflect.Type
	Arguments() []interface{}
	Reply() interface{}
	Attachments() map[string]string
	AttachmentsByKey(string, string) string
	Invoker() Invoker
}

type Invoker

type Invoker interface {
	common.Node
	Invoke(Invocation) Result
}

Extension - Invoker

type Protocol

type Protocol interface {
	Export(invoker Invoker) Exporter
	Refer(url common.URL) Invoker
	Destroy()
}

Extension - protocol

type RPCResult

type RPCResult struct {
	Err  error
	Rest interface{}
}

func (*RPCResult) Error

func (r *RPCResult) Error() error

func (*RPCResult) Result

func (r *RPCResult) Result() interface{}

type Result

type Result interface {
	Error() error
	Result() interface{}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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