protocol

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeginCount

func BeginCount(url common.URL, methodName string)

func EndCount

func EndCount(url common.URL, methodName string)

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 {
	Attrs map[string]string
	Err   error
	Rest  interface{}
}

func (*RPCResult) AddAttachment

func (r *RPCResult) AddAttachment(key, value string)

func (*RPCResult) Attachment

func (r *RPCResult) Attachment(key, defaultValue string) string

func (*RPCResult) Attachments

func (r *RPCResult) Attachments() map[string]string

func (*RPCResult) Error

func (r *RPCResult) Error() error

func (*RPCResult) Result

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

func (*RPCResult) SetAttachments

func (r *RPCResult) SetAttachments(attr map[string]string)

func (*RPCResult) SetError

func (r *RPCResult) SetError(err error)

func (*RPCResult) SetResult

func (r *RPCResult) SetResult(rest interface{})

type Result

type Result interface {
	SetError(error)
	Error() error
	SetResult(interface{})
	Result() interface{}
	SetAttachments(map[string]string)
	Attachments() map[string]string
	AddAttachment(string, string)
	Attachment(string, string) string
}

type RpcStatus

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

func GetStatus

func GetStatus(url common.URL, methodName string) *RpcStatus

func (*RpcStatus) GetActive

func (rpc *RpcStatus) GetActive() int32

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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