Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
22a7f0099
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
22a7f0099
Commits
9fa38960
Commit
9fa38960
authored
4 years ago
by
cvictory
Browse files
Options
Downloads
Patches
Plain Diff
add WithParameterTypeNames in Invocation
parent
04fa9b0e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
protocol/invocation.go
+2
-0
2 additions, 0 deletions
protocol/invocation.go
protocol/invocation/rpcinvocation.go
+17
-2
17 additions, 2 deletions
protocol/invocation/rpcinvocation.go
with
19 additions
and
2 deletions
protocol/invocation.go
+
2
−
0
View file @
9fa38960
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
protocol/invocation/rpcinvocation.go
+
17
−
2
View file @
9fa38960
...
...
@@ -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
{}
...
...
@@ -80,6 +83,11 @@ func (r *RPCInvocation) ParameterTypes() []reflect.Type {
return
r
.
parameterTypes
}
// ParameterTypeNames gets RPC invocation parameter types of string expression.
func
(
r
*
RPCInvocation
)
ParameterTypeNames
()
[]
string
{
return
r
.
parameterTypeNames
}
// ParameterValues gets RPC invocation parameter values.
func
(
r
*
RPCInvocation
)
ParameterValues
()
[]
reflect
.
Value
{
return
r
.
parameterValues
...
...
@@ -213,6 +221,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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment