This is an automated email from the ASF dual-hosted git repository. victory pushed a commit to branch apache_develop in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
commit 070604773501ebdff4fab475c86fc4bbd19fb157 Author: cvictory <[email protected]> AuthorDate: Mon Dec 21 17:05:53 2020 +0800 add WithParameterTypeNames in Invocation --- protocol/invocation.go | 2 ++ protocol/invocation/rpcinvocation.go | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/protocol/invocation.go b/protocol/invocation.go index 452f619e2..2ecc817cc 100644 --- a/protocol/invocation.go +++ b/protocol/invocation.go @@ -25,6 +25,8 @@ import ( type Invocation interface { // MethodName gets invocation method name. MethodName() string + // ParameterTypeNames gets invocation parameter type names. + ParameterTypeNames() []string // ParameterTypes gets invocation parameter types. ParameterTypes() []reflect.Type // ParameterValues gets invocation parameter values. diff --git a/protocol/invocation/rpcinvocation.go b/protocol/invocation/rpcinvocation.go index 4e806324b..86fa77cf8 100644 --- a/protocol/invocation/rpcinvocation.go +++ b/protocol/invocation/rpcinvocation.go @@ -35,8 +35,11 @@ import ( // todo: is it necessary to separate fields of consumer(provider) from RPCInvocation // nolint type RPCInvocation struct { - methodName string - parameterTypes []reflect.Type + methodName string + // Parameter Type Names. It is used to specify the parameterType + ParameterTypeNames []string + parameterTypes []reflect.Type + parameterValues []reflect.Value arguments []interface{} reply interface{} @@ -213,6 +216,13 @@ func WithParameterTypes(parameterTypes []reflect.Type) option { } } +// WithParameterTypeNames creates option with @parameterTypeNames. +func WithParameterTypeNames(parameterTypeNames []string) option { + return func(invo *RPCInvocation) { + invo.ParameterTypeNames = parameterTypeNames + } +} + // WithParameterValues creates option with @parameterValues func WithParameterValues(parameterValues []reflect.Value) option { return func(invo *RPCInvocation) {
