invocation

package
v3.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: Apache-2.0 Imports: 9 Imported by: 75

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithArguments

func WithArguments(arguments []any) option

WithArguments creates option with @arguments function.

func WithAttachment added in v3.3.0

func WithAttachment(k string, v any) option

WithAttachment put a key-value pair into attachments.

func WithAttachments

func WithAttachments(attachments map[string]any) option

WithAttachments creates option with @attachments.

func WithCallBack

func WithCallBack(callBack any) option

WithCallBack creates option with @callback function.

func WithInvoker

func WithInvoker(invoker base.Invoker) option

WithInvoker creates option with @invoker.

func WithMethodName

func WithMethodName(methodName string) option

WithMethodName creates option with @methodName.

func WithParameterRawValues added in v3.3.0

func WithParameterRawValues(parameterRawValues []any) option

WithParameterRawValues creates option with @parameterRawValues

func WithParameterTypeNames

func WithParameterTypeNames(parameterTypeNames []string) option

WithParameterTypeNames creates option with @parameterTypeNames.

func WithParameterTypes

func WithParameterTypes(parameterTypes []reflect.Type) option

WithParameterTypes creates option with @parameterTypes.

func WithParameterValues

func WithParameterValues(parameterValues []reflect.Value) option

WithParameterValues creates option with @parameterValues

func WithReply

func WithReply(reply any) option

WithReply creates option with @reply function.

Types

type RPCInvocation

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

todo: is it necessary to separate fields of consumer(provider) from RPCInvocation RPCInvocation carries method, parameters, attachments and invocation metadata.

func NewRPCInvocation

func NewRPCInvocation(methodName string, arguments []any, attachments map[string]any) *RPCInvocation

NewRPCInvocation creates a RPC invocation.

func NewRPCInvocationWithOptions

func NewRPCInvocationWithOptions(opts ...option) *RPCInvocation

NewRPCInvocationWithOptions creates a RPC invocation with @opts.

func (*RPCInvocation) ActualMethodName added in v3.0.1

func (r *RPCInvocation) ActualMethodName() string

ActualMethodName gets actual invocation method name. It returns the method name been called if it's a generic call

func (*RPCInvocation) Arguments

func (r *RPCInvocation) Arguments() []any

Arguments gets RPC arguments.

func (*RPCInvocation) Attachments

func (r *RPCInvocation) Attachments() map[string]any

Attachments gets all attachments of RPC.

func (*RPCInvocation) Attributes

func (r *RPCInvocation) Attributes() map[string]any

Attributes gets all attributes of RPC.

func (*RPCInvocation) CallBack

func (r *RPCInvocation) CallBack() any

CallBack sets RPC callback method.

func (*RPCInvocation) GetAttachment added in v3.0.1

func (r *RPCInvocation) GetAttachment(key string) (string, bool)

func (*RPCInvocation) GetAttachmentAsContext added in v3.0.2

func (r *RPCInvocation) GetAttachmentAsContext() context.Context

func (*RPCInvocation) GetAttachmentInterface added in v3.0.1

func (r *RPCInvocation) GetAttachmentInterface(key string) any

GetAttachmentInterface returns the corresponding value from dubbo's attachment with the given key.

func (*RPCInvocation) GetAttachmentWithDefaultValue added in v3.0.1

func (r *RPCInvocation) GetAttachmentWithDefaultValue(key string, defaultValue string) string

func (*RPCInvocation) GetAttribute added in v3.0.1

func (r *RPCInvocation) GetAttribute(key string) (any, bool)

func (*RPCInvocation) GetAttributeWithDefaultValue added in v3.0.1

func (r *RPCInvocation) GetAttributeWithDefaultValue(key string, defaultValue any) any

func (*RPCInvocation) Invoker

func (r *RPCInvocation) Invoker() base.Invoker

Invoker gets the invoker in current context.

func (*RPCInvocation) IsGenericInvocation added in v3.0.1

func (r *RPCInvocation) IsGenericInvocation() bool

IsGenericInvocation gets if this is a generic invocation

func (*RPCInvocation) MergeAttachmentFromContext added in v3.3.0

func (r *RPCInvocation) MergeAttachmentFromContext(ctx context.Context)

func (*RPCInvocation) MethodName

func (r *RPCInvocation) MethodName() string

MethodName gets RPC invocation method name.

func (*RPCInvocation) ParameterRawValues added in v3.3.0

func (r *RPCInvocation) ParameterRawValues() []any

func (*RPCInvocation) ParameterTypeNames

func (r *RPCInvocation) ParameterTypeNames() []string

ParameterTypeNames gets RPC invocation parameter types of string expression.

func (*RPCInvocation) ParameterTypes

func (r *RPCInvocation) ParameterTypes() []reflect.Type

ParameterTypes gets RPC invocation parameter types.

func (*RPCInvocation) ParameterValues

func (r *RPCInvocation) ParameterValues() []reflect.Value

ParameterValues gets RPC invocation parameter values.

func (*RPCInvocation) Reply

func (r *RPCInvocation) Reply() any

Reply gets response of RPC request.

func (*RPCInvocation) ServiceKey

func (r *RPCInvocation) ServiceKey() string

func (*RPCInvocation) SetAttachment added in v3.0.1

func (r *RPCInvocation) SetAttachment(key string, value any)

func (*RPCInvocation) SetAttribute

func (r *RPCInvocation) SetAttribute(key string, value any)

func (*RPCInvocation) SetCallBack

func (r *RPCInvocation) SetCallBack(c any)

SetCallBack sets RPC callback method.

func (*RPCInvocation) SetInvoker

func (r *RPCInvocation) SetInvoker(invoker base.Invoker)

SetInvoker sets the invoker in current context (thread-safe).

func (*RPCInvocation) SetReply

func (r *RPCInvocation) SetReply(reply any)

SetReply sets response of RPC request.

Jump to

Keyboard shortcuts

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