good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jrpc
Manage
Activity
Members
Labels
Plan
Issues
6
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
jrpc
Commits
d256a870
Commit
d256a870
authored
2 years ago
by
a
Browse files
Options
Downloads
Patches
Plain Diff
new id and version marshalers
parent
1ea0d7c4
No related branches found
Branches containing commit
Tags
v0.0.17
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wire.go
+0
-42
0 additions, 42 deletions
wire.go
with
0 additions
and
42 deletions
wire.go
+
0
−
42
View file @
d256a870
...
...
@@ -131,45 +131,3 @@ func (id *ID) UnmarshalJSON(data []byte) error {
id
.
null
=
true
return
nil
}
// wireRequest is sent to a server to represent a Call or Notify operaton.
type
wireRequest
struct
{
// VersionTag is always encoded as the string "2.0"
VersionTag
version
`json:"jsonrpc"`
// Method is a string containing the method name to invoke.
Method
string
`json:"method"`
// Params is either a struct or an array with the parameters of the method.
Params
*
json
.
RawMessage
`json:"params,omitempty"`
// The id of this request, used to tie the Response back to the request.
// Will be either a string or a number. If not set, the Request is a notify,
// and no response is possible.
ID
*
ID
`json:"id,omitempty"`
}
// wireResponse is a reply to a Request.
//
// It will always have the ID field set to tie it back to a request, and will
// have either the Result or Error fields set depending on whether it is a
// success or failure wireResponse.
type
wireResponse
struct
{
// VersionTag is always encoded as the string "2.0"
VersionTag
version
`json:"jsonrpc"`
// Result is the response value, and is required on success.
Result
*
json
.
RawMessage
`json:"result,omitempty"`
// Error is a structured error response if the call fails.
Error
*
Error
`json:"error,omitempty"`
// ID must be set and is the identifier of the Request this is a response to.
ID
*
ID
`json:"id,omitempty"`
}
// combined has all the fields of both Request and Response.
//
// We can decode this and then work out which it is.
type
combined
struct
{
VersionTag
version
`json:"jsonrpc"`
ID
*
ID
`json:"id,omitempty"`
Method
string
`json:"method"`
Params
*
json
.
RawMessage
`json:"params,omitempty"`
Result
*
json
.
RawMessage
`json:"result,omitempty"`
Error
*
Error
`json:"error,omitempty"`
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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