protocol

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: Apache-2.0 Imports: 7 Imported by: 47

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeginCount

func BeginCount(url common.URL, methodName string)

BeginCount ...

func CleanAllStatus added in v1.4.0

func CleanAllStatus()

Destroy is used to clean all status

func CurrentTimeMillis added in v1.4.0

func CurrentTimeMillis() int64

CurrentTimeMillis ...

func EndCount

func EndCount(url common.URL, methodName string, elapsed int64, succeeded bool)

EndCount ...

Types

type BaseExporter

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

BaseExporter ...

func NewBaseExporter

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

NewBaseExporter ...

func (*BaseExporter) GetInvoker

func (de *BaseExporter) GetInvoker() Invoker

GetInvoker ...

func (*BaseExporter) Unexport

func (de *BaseExporter) Unexport()

Unexport ...

type BaseInvoker

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

BaseInvoker ...

func NewBaseInvoker

func NewBaseInvoker(url common.URL) *BaseInvoker

NewBaseInvoker ...

func (*BaseInvoker) Destroy

func (bi *BaseInvoker) Destroy()

Destroy ...

func (*BaseInvoker) GetUrl

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

GetUrl ...

func (*BaseInvoker) Invoke

func (bi *BaseInvoker) Invoke(context context.Context, invocation Invocation) Result

Invoke ...

func (*BaseInvoker) IsAvailable

func (bi *BaseInvoker) IsAvailable() bool

IsAvailable ...

func (*BaseInvoker) IsDestroyed

func (bi *BaseInvoker) IsDestroyed() bool

IsDestroyed ...

type BaseProtocol

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

BaseProtocol ...

func NewBaseProtocol

func NewBaseProtocol() BaseProtocol

NewBaseProtocol ...

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

Export ...

func (*BaseProtocol) ExporterMap

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

ExporterMap ...

func (*BaseProtocol) Invokers

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

Invokers ...

func (*BaseProtocol) Refer

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

Refer ...

func (*BaseProtocol) SetExporterMap

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

SetExporterMap ...

func (*BaseProtocol) SetInvokers

func (bp *BaseProtocol) SetInvokers(invoker Invoker)

SetInvokers ...

type Exporter

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

Exporter wrapping invoker

type Invocation

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

Invocation ...

type Invoker

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

Invoker ... Extension - Invoker

type Protocol

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

Protocol Extension - protocol

type RPCResult

type RPCResult struct {
	Attrs map[string]string
	Err   error
	Rest  interface{}
}

RPCResult ...

func (*RPCResult) AddAttachment

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

AddAttachment ...

func (*RPCResult) Attachment

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

Attachment ...

func (*RPCResult) Attachments

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

Attachments ...

func (*RPCResult) Error

func (r *RPCResult) Error() error

func (*RPCResult) Result

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

Result ...

func (*RPCResult) SetAttachments

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

SetAttachments ...

func (*RPCResult) SetError

func (r *RPCResult) SetError(err error)

SetError ...

func (*RPCResult) SetResult

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

SetResult ...

type RPCStatus added in v1.4.0

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

RPCStatus ...

func GetMethodStatus added in v1.4.0

func GetMethodStatus(url common.URL, methodName string) *RPCStatus

GetMethodStatus ...

func GetURLStatus added in v1.4.0

func GetURLStatus(url common.URL) *RPCStatus

GetURLStatus ...

func (*RPCStatus) GetActive added in v1.4.0

func (rpc *RPCStatus) GetActive() int32

GetActive ...

func (*RPCStatus) GetFailed added in v1.4.0

func (rpc *RPCStatus) GetFailed() int32

GetFailed ...

func (*RPCStatus) GetFailedElapsed added in v1.4.0

func (rpc *RPCStatus) GetFailedElapsed() int64

GetFailedElapsed ...

func (*RPCStatus) GetFailedMaxElapsed added in v1.4.0

func (rpc *RPCStatus) GetFailedMaxElapsed() int64

GetFailedMaxElapsed ...

func (*RPCStatus) GetLastRequestFailedTimestamp added in v1.4.0

func (rpc *RPCStatus) GetLastRequestFailedTimestamp() int64

GetLastRequestFailedTimestamp ...

func (*RPCStatus) GetMaxElapsed added in v1.4.0

func (rpc *RPCStatus) GetMaxElapsed() int64

GetMaxElapsed ...

func (*RPCStatus) GetSucceededMaxElapsed added in v1.4.0

func (rpc *RPCStatus) GetSucceededMaxElapsed() int64

GetSucceededMaxElapsed ...

func (*RPCStatus) GetSuccessiveRequestFailureCount added in v1.4.0

func (rpc *RPCStatus) GetSuccessiveRequestFailureCount() int32

GetSuccessiveRequestFailureCount ...

func (*RPCStatus) GetTotal added in v1.4.0

func (rpc *RPCStatus) GetTotal() int32

GetTotal ...

func (*RPCStatus) GetTotalElapsed added in v1.4.0

func (rpc *RPCStatus) GetTotalElapsed() int64

GetTotalElapsed ...

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
}

Result ...

Directories

Path Synopsis
dubbo3
internal
just for test, never use internal for production.
just for test, never use internal for production.
protoc-gen-dubbo/plugin/dubbo
Package dubbo plugin for protobuf.
Package dubbo plugin for protobuf.
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