starpc 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Makefile +21 -14
- package/e2e/mock/mock.pb.go +37 -14
- package/echo/echo.pb.go +37 -14
- package/go.mod +8 -8
- package/go.sum +12 -4
- package/package.json +1 -1
- package/srpc/rpcproto.pb.go +176 -70
- package/integration/integration_srpc.pb.go +0 -139
package/Makefile
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# https://github.com/aperturerobotics/protobuf-project
|
|
2
2
|
|
|
3
3
|
SHELL:=bash
|
|
4
|
-
ESBUILD=hack/bin/esbuild
|
|
5
4
|
PROTOWRAP=hack/bin/protowrap
|
|
6
5
|
PROTOC_GEN_GO=hack/bin/protoc-gen-go-lite
|
|
7
6
|
PROTOC_GEN_STARPC=hack/bin/protoc-gen-go-starpc
|
|
8
7
|
GOIMPORTS=hack/bin/goimports
|
|
8
|
+
GOFUMPT=hack/bin/gofumpt
|
|
9
9
|
GOLANGCI_LINT=hack/bin/golangci-lint
|
|
10
10
|
GO_MOD_OUTDATED=hack/bin/go-mod-outdated
|
|
11
|
+
ESBUILD=hack/bin/esbuild
|
|
11
12
|
GOLIST=go list -f "{{ .Dir }}" -m
|
|
12
13
|
|
|
13
14
|
export GO111MODULE=on
|
|
@@ -19,30 +20,24 @@ all:
|
|
|
19
20
|
vendor:
|
|
20
21
|
go mod vendor
|
|
21
22
|
|
|
22
|
-
$(ESBUILD):
|
|
23
|
-
cd ./hack; \
|
|
24
|
-
go build -v \
|
|
25
|
-
-o ./bin/esbuild \
|
|
26
|
-
github.com/evanw/esbuild/cmd/esbuild
|
|
27
|
-
|
|
28
23
|
$(PROTOC_GEN_GO):
|
|
29
24
|
cd ./hack; \
|
|
30
25
|
go build -v \
|
|
31
26
|
-o ./bin/protoc-gen-go-lite \
|
|
32
27
|
github.com/aperturerobotics/protobuf-go-lite/cmd/protoc-gen-go-lite
|
|
33
28
|
|
|
34
|
-
$(PROTOC_GEN_STARPC):
|
|
35
|
-
cd ./hack; \
|
|
36
|
-
go build -v \
|
|
37
|
-
-o ./bin/protoc-gen-go-starpc \
|
|
38
|
-
github.com/aperturerobotics/starpc/cmd/protoc-gen-go-starpc
|
|
39
|
-
|
|
40
29
|
$(GOIMPORTS):
|
|
41
30
|
cd ./hack; \
|
|
42
31
|
go build -v \
|
|
43
32
|
-o ./bin/goimports \
|
|
44
33
|
golang.org/x/tools/cmd/goimports
|
|
45
34
|
|
|
35
|
+
$(GOFUMPT):
|
|
36
|
+
cd ./hack; \
|
|
37
|
+
go build -v \
|
|
38
|
+
-o ./bin/gofumpt \
|
|
39
|
+
mvdan.cc/gofumpt
|
|
40
|
+
|
|
46
41
|
$(PROTOWRAP):
|
|
47
42
|
cd ./hack; \
|
|
48
43
|
go build -v \
|
|
@@ -61,6 +56,18 @@ $(GO_MOD_OUTDATED):
|
|
|
61
56
|
-o ./bin/go-mod-outdated \
|
|
62
57
|
github.com/psampaz/go-mod-outdated
|
|
63
58
|
|
|
59
|
+
$(PROTOC_GEN_STARPC):
|
|
60
|
+
cd ./hack; \
|
|
61
|
+
go build -v \
|
|
62
|
+
-o ./bin/protoc-gen-go-starpc \
|
|
63
|
+
github.com/aperturerobotics/starpc/cmd/protoc-gen-go-starpc
|
|
64
|
+
|
|
65
|
+
$(ESBUILD):
|
|
66
|
+
cd ./hack; \
|
|
67
|
+
go build -v \
|
|
68
|
+
-o ./bin/esbuild \
|
|
69
|
+
github.com/evanw/esbuild/cmd/esbuild
|
|
70
|
+
|
|
64
71
|
node_modules:
|
|
65
72
|
yarn install
|
|
66
73
|
|
|
@@ -78,7 +85,7 @@ genproto: vendor node_modules $(GOIMPORTS) $(PROTOWRAP) $(PROTOC_GEN_GO) $(PROTO
|
|
|
78
85
|
-I $$(pwd)/vendor \
|
|
79
86
|
--plugin=./node_modules/.bin/protoc-gen-ts_proto \
|
|
80
87
|
--go-lite_out=$$(pwd)/vendor \
|
|
81
|
-
--go-lite_opt=features=marshal+unmarshal+size+equal+clone \
|
|
88
|
+
--go-lite_opt=features=marshal+unmarshal+size+equal+json+clone \
|
|
82
89
|
--go-starpc_out=$$(pwd)/vendor \
|
|
83
90
|
--ts_proto_out=$$(pwd)/vendor \
|
|
84
91
|
--ts_proto_opt=esModuleInterop=true \
|
package/e2e/mock/mock.pb.go
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// Code generated by protoc-gen-go-lite. DO NOT EDIT.
|
|
2
|
-
// protoc-gen-go-lite version: v0.
|
|
2
|
+
// protoc-gen-go-lite version: v0.3.1
|
|
3
3
|
// source: github.com/aperturerobotics/starpc/e2e/mock/mock.proto
|
|
4
4
|
|
|
5
5
|
package e2e_mock
|
|
6
6
|
|
|
7
7
|
import (
|
|
8
|
-
fmt "fmt"
|
|
9
8
|
io "io"
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
protobuf_go_lite "github.com/aperturerobotics/protobuf-go-lite"
|
|
11
|
+
json "github.com/aperturerobotics/protobuf-go-lite/json"
|
|
12
|
+
errors "github.com/pkg/errors"
|
|
12
13
|
)
|
|
13
14
|
|
|
14
15
|
// MockMsg is the mock message body.
|
|
@@ -66,6 +67,28 @@ func (this *MockMsg) EqualMessageVT(thatMsg any) bool {
|
|
|
66
67
|
}
|
|
67
68
|
return this.EqualVT(that)
|
|
68
69
|
}
|
|
70
|
+
|
|
71
|
+
// MarshalProtoJSON marshals the MockMsg message to JSON.
|
|
72
|
+
func (x *MockMsg) MarshalProtoJSON(s *json.MarshalState) {
|
|
73
|
+
if x == nil {
|
|
74
|
+
s.WriteNil()
|
|
75
|
+
return
|
|
76
|
+
}
|
|
77
|
+
s.WriteObjectStart()
|
|
78
|
+
var wroteField bool
|
|
79
|
+
if x.Body != "" || s.HasField("body") {
|
|
80
|
+
s.WriteMoreIf(&wroteField)
|
|
81
|
+
s.WriteObjectField("body")
|
|
82
|
+
s.WriteString(x.Body)
|
|
83
|
+
}
|
|
84
|
+
s.WriteObjectEnd()
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// MarshalJSON marshals the MockMsg to JSON.
|
|
88
|
+
func (x *MockMsg) MarshalJSON() ([]byte, error) {
|
|
89
|
+
return json.DefaultMarshalerConfig.Marshal(x)
|
|
90
|
+
}
|
|
91
|
+
|
|
69
92
|
func (m *MockMsg) MarshalVT() (dAtA []byte, err error) {
|
|
70
93
|
if m == nil {
|
|
71
94
|
return nil, nil
|
|
@@ -99,7 +122,7 @@ func (m *MockMsg) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
|
|
|
99
122
|
if len(m.Body) > 0 {
|
|
100
123
|
i -= len(m.Body)
|
|
101
124
|
copy(dAtA[i:], m.Body)
|
|
102
|
-
i =
|
|
125
|
+
i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(len(m.Body)))
|
|
103
126
|
i--
|
|
104
127
|
dAtA[i] = 0xa
|
|
105
128
|
}
|
|
@@ -114,7 +137,7 @@ func (m *MockMsg) SizeVT() (n int) {
|
|
|
114
137
|
_ = l
|
|
115
138
|
l = len(m.Body)
|
|
116
139
|
if l > 0 {
|
|
117
|
-
n += 1 + l +
|
|
140
|
+
n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
|
|
118
141
|
}
|
|
119
142
|
n += len(m.unknownFields)
|
|
120
143
|
return n
|
|
@@ -128,7 +151,7 @@ func (m *MockMsg) UnmarshalVT(dAtA []byte) error {
|
|
|
128
151
|
var wire uint64
|
|
129
152
|
for shift := uint(0); ; shift += 7 {
|
|
130
153
|
if shift >= 64 {
|
|
131
|
-
return
|
|
154
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
132
155
|
}
|
|
133
156
|
if iNdEx >= l {
|
|
134
157
|
return io.ErrUnexpectedEOF
|
|
@@ -143,20 +166,20 @@ func (m *MockMsg) UnmarshalVT(dAtA []byte) error {
|
|
|
143
166
|
fieldNum := int32(wire >> 3)
|
|
144
167
|
wireType := int(wire & 0x7)
|
|
145
168
|
if wireType == 4 {
|
|
146
|
-
return
|
|
169
|
+
return errors.Errorf("proto: MockMsg: wiretype end group for non-group")
|
|
147
170
|
}
|
|
148
171
|
if fieldNum <= 0 {
|
|
149
|
-
return
|
|
172
|
+
return errors.Errorf("proto: MockMsg: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
150
173
|
}
|
|
151
174
|
switch fieldNum {
|
|
152
175
|
case 1:
|
|
153
176
|
if wireType != 2 {
|
|
154
|
-
return
|
|
177
|
+
return errors.Errorf("proto: wrong wireType = %d for field Body", wireType)
|
|
155
178
|
}
|
|
156
179
|
var stringLen uint64
|
|
157
180
|
for shift := uint(0); ; shift += 7 {
|
|
158
181
|
if shift >= 64 {
|
|
159
|
-
return
|
|
182
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
160
183
|
}
|
|
161
184
|
if iNdEx >= l {
|
|
162
185
|
return io.ErrUnexpectedEOF
|
|
@@ -170,11 +193,11 @@ func (m *MockMsg) UnmarshalVT(dAtA []byte) error {
|
|
|
170
193
|
}
|
|
171
194
|
intStringLen := int(stringLen)
|
|
172
195
|
if intStringLen < 0 {
|
|
173
|
-
return
|
|
196
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
174
197
|
}
|
|
175
198
|
postIndex := iNdEx + intStringLen
|
|
176
199
|
if postIndex < 0 {
|
|
177
|
-
return
|
|
200
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
178
201
|
}
|
|
179
202
|
if postIndex > l {
|
|
180
203
|
return io.ErrUnexpectedEOF
|
|
@@ -183,12 +206,12 @@ func (m *MockMsg) UnmarshalVT(dAtA []byte) error {
|
|
|
183
206
|
iNdEx = postIndex
|
|
184
207
|
default:
|
|
185
208
|
iNdEx = preIndex
|
|
186
|
-
skippy, err :=
|
|
209
|
+
skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:])
|
|
187
210
|
if err != nil {
|
|
188
211
|
return err
|
|
189
212
|
}
|
|
190
213
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
191
|
-
return
|
|
214
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
192
215
|
}
|
|
193
216
|
if (iNdEx + skippy) > l {
|
|
194
217
|
return io.ErrUnexpectedEOF
|
package/echo/echo.pb.go
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
// Code generated by protoc-gen-go-lite. DO NOT EDIT.
|
|
2
|
-
// protoc-gen-go-lite version: v0.
|
|
2
|
+
// protoc-gen-go-lite version: v0.3.1
|
|
3
3
|
// source: github.com/aperturerobotics/starpc/echo/echo.proto
|
|
4
4
|
|
|
5
5
|
package echo
|
|
6
6
|
|
|
7
7
|
import (
|
|
8
|
-
fmt "fmt"
|
|
9
8
|
io "io"
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
protobuf_go_lite "github.com/aperturerobotics/protobuf-go-lite"
|
|
11
|
+
json "github.com/aperturerobotics/protobuf-go-lite/json"
|
|
12
12
|
_ "github.com/aperturerobotics/starpc/rpcstream"
|
|
13
|
+
errors "github.com/pkg/errors"
|
|
13
14
|
)
|
|
14
15
|
|
|
15
16
|
// EchoMsg is the message body for Echo.
|
|
@@ -67,6 +68,28 @@ func (this *EchoMsg) EqualMessageVT(thatMsg any) bool {
|
|
|
67
68
|
}
|
|
68
69
|
return this.EqualVT(that)
|
|
69
70
|
}
|
|
71
|
+
|
|
72
|
+
// MarshalProtoJSON marshals the EchoMsg message to JSON.
|
|
73
|
+
func (x *EchoMsg) MarshalProtoJSON(s *json.MarshalState) {
|
|
74
|
+
if x == nil {
|
|
75
|
+
s.WriteNil()
|
|
76
|
+
return
|
|
77
|
+
}
|
|
78
|
+
s.WriteObjectStart()
|
|
79
|
+
var wroteField bool
|
|
80
|
+
if x.Body != "" || s.HasField("body") {
|
|
81
|
+
s.WriteMoreIf(&wroteField)
|
|
82
|
+
s.WriteObjectField("body")
|
|
83
|
+
s.WriteString(x.Body)
|
|
84
|
+
}
|
|
85
|
+
s.WriteObjectEnd()
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// MarshalJSON marshals the EchoMsg to JSON.
|
|
89
|
+
func (x *EchoMsg) MarshalJSON() ([]byte, error) {
|
|
90
|
+
return json.DefaultMarshalerConfig.Marshal(x)
|
|
91
|
+
}
|
|
92
|
+
|
|
70
93
|
func (m *EchoMsg) MarshalVT() (dAtA []byte, err error) {
|
|
71
94
|
if m == nil {
|
|
72
95
|
return nil, nil
|
|
@@ -100,7 +123,7 @@ func (m *EchoMsg) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
|
|
|
100
123
|
if len(m.Body) > 0 {
|
|
101
124
|
i -= len(m.Body)
|
|
102
125
|
copy(dAtA[i:], m.Body)
|
|
103
|
-
i =
|
|
126
|
+
i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(len(m.Body)))
|
|
104
127
|
i--
|
|
105
128
|
dAtA[i] = 0xa
|
|
106
129
|
}
|
|
@@ -115,7 +138,7 @@ func (m *EchoMsg) SizeVT() (n int) {
|
|
|
115
138
|
_ = l
|
|
116
139
|
l = len(m.Body)
|
|
117
140
|
if l > 0 {
|
|
118
|
-
n += 1 + l +
|
|
141
|
+
n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
|
|
119
142
|
}
|
|
120
143
|
n += len(m.unknownFields)
|
|
121
144
|
return n
|
|
@@ -129,7 +152,7 @@ func (m *EchoMsg) UnmarshalVT(dAtA []byte) error {
|
|
|
129
152
|
var wire uint64
|
|
130
153
|
for shift := uint(0); ; shift += 7 {
|
|
131
154
|
if shift >= 64 {
|
|
132
|
-
return
|
|
155
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
133
156
|
}
|
|
134
157
|
if iNdEx >= l {
|
|
135
158
|
return io.ErrUnexpectedEOF
|
|
@@ -144,20 +167,20 @@ func (m *EchoMsg) UnmarshalVT(dAtA []byte) error {
|
|
|
144
167
|
fieldNum := int32(wire >> 3)
|
|
145
168
|
wireType := int(wire & 0x7)
|
|
146
169
|
if wireType == 4 {
|
|
147
|
-
return
|
|
170
|
+
return errors.Errorf("proto: EchoMsg: wiretype end group for non-group")
|
|
148
171
|
}
|
|
149
172
|
if fieldNum <= 0 {
|
|
150
|
-
return
|
|
173
|
+
return errors.Errorf("proto: EchoMsg: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
151
174
|
}
|
|
152
175
|
switch fieldNum {
|
|
153
176
|
case 1:
|
|
154
177
|
if wireType != 2 {
|
|
155
|
-
return
|
|
178
|
+
return errors.Errorf("proto: wrong wireType = %d for field Body", wireType)
|
|
156
179
|
}
|
|
157
180
|
var stringLen uint64
|
|
158
181
|
for shift := uint(0); ; shift += 7 {
|
|
159
182
|
if shift >= 64 {
|
|
160
|
-
return
|
|
183
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
161
184
|
}
|
|
162
185
|
if iNdEx >= l {
|
|
163
186
|
return io.ErrUnexpectedEOF
|
|
@@ -171,11 +194,11 @@ func (m *EchoMsg) UnmarshalVT(dAtA []byte) error {
|
|
|
171
194
|
}
|
|
172
195
|
intStringLen := int(stringLen)
|
|
173
196
|
if intStringLen < 0 {
|
|
174
|
-
return
|
|
197
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
175
198
|
}
|
|
176
199
|
postIndex := iNdEx + intStringLen
|
|
177
200
|
if postIndex < 0 {
|
|
178
|
-
return
|
|
201
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
179
202
|
}
|
|
180
203
|
if postIndex > l {
|
|
181
204
|
return io.ErrUnexpectedEOF
|
|
@@ -184,12 +207,12 @@ func (m *EchoMsg) UnmarshalVT(dAtA []byte) error {
|
|
|
184
207
|
iNdEx = postIndex
|
|
185
208
|
default:
|
|
186
209
|
iNdEx = preIndex
|
|
187
|
-
skippy, err :=
|
|
210
|
+
skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:])
|
|
188
211
|
if err != nil {
|
|
189
212
|
return err
|
|
190
213
|
}
|
|
191
214
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
192
|
-
return
|
|
215
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
193
216
|
}
|
|
194
217
|
if (iNdEx + skippy) > l {
|
|
195
218
|
return io.ErrUnexpectedEOF
|
package/go.mod
CHANGED
|
@@ -2,29 +2,29 @@ module github.com/aperturerobotics/starpc
|
|
|
2
2
|
|
|
3
3
|
go 1.22
|
|
4
4
|
|
|
5
|
-
toolchain go1.22.1
|
|
6
|
-
|
|
7
5
|
require (
|
|
8
|
-
github.com/
|
|
9
|
-
|
|
10
|
-
nhooyr.io/websocket v1.8.11 // latest
|
|
6
|
+
github.com/aperturerobotics/protobuf-go-lite v0.3.1 // latest
|
|
7
|
+
github.com/aperturerobotics/util v1.17.0 // latest
|
|
11
8
|
)
|
|
12
9
|
|
|
13
10
|
require (
|
|
14
|
-
github.com/aperturerobotics/util v1.16.5 // latest
|
|
15
11
|
github.com/libp2p/go-libp2p v0.33.2 // latest
|
|
16
12
|
github.com/libp2p/go-yamux/v4 v4.0.2-0.20240322071716-53ef5820bd48 // master
|
|
13
|
+
github.com/pkg/errors v0.9.1 // latest
|
|
17
14
|
github.com/sirupsen/logrus v1.9.3 // latest
|
|
15
|
+
google.golang.org/protobuf v1.33.0 // latest
|
|
16
|
+
nhooyr.io/websocket v1.8.11 // latest
|
|
18
17
|
)
|
|
19
18
|
|
|
20
|
-
require github.com/aperturerobotics/protobuf-go-lite v0.2.3
|
|
21
|
-
|
|
22
19
|
require (
|
|
23
20
|
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
|
|
24
21
|
github.com/ipfs/go-cid v0.4.1 // indirect
|
|
22
|
+
github.com/json-iterator/go v1.1.12 // indirect
|
|
25
23
|
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
|
|
26
24
|
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
|
|
27
25
|
github.com/minio/sha256-simd v1.0.1 // indirect
|
|
26
|
+
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
|
|
27
|
+
github.com/modern-go/reflect2 v1.0.2 // indirect
|
|
28
28
|
github.com/mr-tron/base58 v1.2.0 // indirect
|
|
29
29
|
github.com/multiformats/go-base32 v0.1.0 // indirect
|
|
30
30
|
github.com/multiformats/go-base36 v0.2.0 // indirect
|
package/go.sum
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
github.com/aperturerobotics/protobuf-go-lite v0.
|
|
2
|
-
github.com/aperturerobotics/protobuf-go-lite v0.
|
|
3
|
-
github.com/aperturerobotics/util v1.
|
|
4
|
-
github.com/aperturerobotics/util v1.
|
|
1
|
+
github.com/aperturerobotics/protobuf-go-lite v0.3.1 h1:6A1y0dsrRGNj26xG5ohy6nheSeZAt6GApIGo02dA91k=
|
|
2
|
+
github.com/aperturerobotics/protobuf-go-lite v0.3.1/go.mod h1:wRZn4YydbTn8Bdx4NB6ms0doF19llgim+0SNBvQ7M9c=
|
|
3
|
+
github.com/aperturerobotics/util v1.17.0 h1:eN9/NVXpf51OZQ4ERgGar/49kL1Pl8puW1MIYiYlA/8=
|
|
4
|
+
github.com/aperturerobotics/util v1.17.0/go.mod h1:YAWPti3PGLd1vagad3uMa3OfOLKo0rMXv80UJJPT0NA=
|
|
5
5
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
6
6
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
7
7
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
@@ -11,8 +11,11 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etly
|
|
|
11
11
|
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
|
|
12
12
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
|
13
13
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
|
14
|
+
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
|
14
15
|
github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
|
|
15
16
|
github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk=
|
|
17
|
+
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
|
18
|
+
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
|
16
19
|
github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=
|
|
17
20
|
github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
|
|
18
21
|
github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8=
|
|
@@ -25,6 +28,10 @@ github.com/libp2p/go-yamux/v4 v4.0.2-0.20240322071716-53ef5820bd48 h1:KI65sCCL2h
|
|
|
25
28
|
github.com/libp2p/go-yamux/v4 v4.0.2-0.20240322071716-53ef5820bd48/go.mod h1:PGP+3py2ZWDKABvqstBZtMnixEHNC7U/odnGylzur5o=
|
|
26
29
|
github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
|
|
27
30
|
github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
|
|
31
|
+
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
|
|
32
|
+
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
|
33
|
+
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
|
34
|
+
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
|
28
35
|
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
|
|
29
36
|
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
|
|
30
37
|
github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE=
|
|
@@ -52,6 +59,7 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs
|
|
|
52
59
|
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
|
|
53
60
|
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
|
54
61
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
|
62
|
+
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
|
55
63
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
|
56
64
|
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
|
57
65
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
package/package.json
CHANGED
package/srpc/rpcproto.pb.go
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// Code generated by protoc-gen-go-lite. DO NOT EDIT.
|
|
2
|
-
// protoc-gen-go-lite version: v0.
|
|
2
|
+
// protoc-gen-go-lite version: v0.3.1
|
|
3
3
|
// source: github.com/aperturerobotics/starpc/srpc/rpcproto.proto
|
|
4
4
|
|
|
5
5
|
package srpc
|
|
6
6
|
|
|
7
7
|
import (
|
|
8
|
-
fmt "fmt"
|
|
9
8
|
io "io"
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
protobuf_go_lite "github.com/aperturerobotics/protobuf-go-lite"
|
|
11
|
+
json "github.com/aperturerobotics/protobuf-go-lite/json"
|
|
12
|
+
errors "github.com/pkg/errors"
|
|
12
13
|
)
|
|
13
14
|
|
|
14
15
|
// Packet is a message sent over a srpc packet connection.
|
|
@@ -424,6 +425,111 @@ func (this *CallData) EqualMessageVT(thatMsg any) bool {
|
|
|
424
425
|
}
|
|
425
426
|
return this.EqualVT(that)
|
|
426
427
|
}
|
|
428
|
+
|
|
429
|
+
// MarshalProtoJSON marshals the Packet message to JSON.
|
|
430
|
+
func (x *Packet) MarshalProtoJSON(s *json.MarshalState) {
|
|
431
|
+
if x == nil {
|
|
432
|
+
s.WriteNil()
|
|
433
|
+
return
|
|
434
|
+
}
|
|
435
|
+
s.WriteObjectStart()
|
|
436
|
+
var wroteField bool
|
|
437
|
+
if x.Body != nil {
|
|
438
|
+
switch ov := x.Body.(type) {
|
|
439
|
+
case *Packet_CallStart:
|
|
440
|
+
s.WriteMoreIf(&wroteField)
|
|
441
|
+
s.WriteObjectField("call_start")
|
|
442
|
+
ov.CallStart.MarshalProtoJSON(s.WithField("call_start"))
|
|
443
|
+
case *Packet_CallData:
|
|
444
|
+
s.WriteMoreIf(&wroteField)
|
|
445
|
+
s.WriteObjectField("call_data")
|
|
446
|
+
ov.CallData.MarshalProtoJSON(s.WithField("call_data"))
|
|
447
|
+
case *Packet_CallCancel:
|
|
448
|
+
s.WriteMoreIf(&wroteField)
|
|
449
|
+
s.WriteObjectField("call_cancel")
|
|
450
|
+
s.WriteBool(ov.CallCancel)
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
s.WriteObjectEnd()
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// MarshalJSON marshals the Packet to JSON.
|
|
457
|
+
func (x *Packet) MarshalJSON() ([]byte, error) {
|
|
458
|
+
return json.DefaultMarshalerConfig.Marshal(x)
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
// MarshalProtoJSON marshals the CallStart message to JSON.
|
|
462
|
+
func (x *CallStart) MarshalProtoJSON(s *json.MarshalState) {
|
|
463
|
+
if x == nil {
|
|
464
|
+
s.WriteNil()
|
|
465
|
+
return
|
|
466
|
+
}
|
|
467
|
+
s.WriteObjectStart()
|
|
468
|
+
var wroteField bool
|
|
469
|
+
if x.RpcService != "" || s.HasField("rpc_service") {
|
|
470
|
+
s.WriteMoreIf(&wroteField)
|
|
471
|
+
s.WriteObjectField("rpc_service")
|
|
472
|
+
s.WriteString(x.RpcService)
|
|
473
|
+
}
|
|
474
|
+
if x.RpcMethod != "" || s.HasField("rpc_method") {
|
|
475
|
+
s.WriteMoreIf(&wroteField)
|
|
476
|
+
s.WriteObjectField("rpc_method")
|
|
477
|
+
s.WriteString(x.RpcMethod)
|
|
478
|
+
}
|
|
479
|
+
if len(x.Data) > 0 || s.HasField("data") {
|
|
480
|
+
s.WriteMoreIf(&wroteField)
|
|
481
|
+
s.WriteObjectField("data")
|
|
482
|
+
s.WriteBytes(x.Data)
|
|
483
|
+
}
|
|
484
|
+
if x.DataIsZero || s.HasField("data_is_zero") {
|
|
485
|
+
s.WriteMoreIf(&wroteField)
|
|
486
|
+
s.WriteObjectField("data_is_zero")
|
|
487
|
+
s.WriteBool(x.DataIsZero)
|
|
488
|
+
}
|
|
489
|
+
s.WriteObjectEnd()
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
// MarshalJSON marshals the CallStart to JSON.
|
|
493
|
+
func (x *CallStart) MarshalJSON() ([]byte, error) {
|
|
494
|
+
return json.DefaultMarshalerConfig.Marshal(x)
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// MarshalProtoJSON marshals the CallData message to JSON.
|
|
498
|
+
func (x *CallData) MarshalProtoJSON(s *json.MarshalState) {
|
|
499
|
+
if x == nil {
|
|
500
|
+
s.WriteNil()
|
|
501
|
+
return
|
|
502
|
+
}
|
|
503
|
+
s.WriteObjectStart()
|
|
504
|
+
var wroteField bool
|
|
505
|
+
if len(x.Data) > 0 || s.HasField("data") {
|
|
506
|
+
s.WriteMoreIf(&wroteField)
|
|
507
|
+
s.WriteObjectField("data")
|
|
508
|
+
s.WriteBytes(x.Data)
|
|
509
|
+
}
|
|
510
|
+
if x.DataIsZero || s.HasField("data_is_zero") {
|
|
511
|
+
s.WriteMoreIf(&wroteField)
|
|
512
|
+
s.WriteObjectField("data_is_zero")
|
|
513
|
+
s.WriteBool(x.DataIsZero)
|
|
514
|
+
}
|
|
515
|
+
if x.Complete || s.HasField("complete") {
|
|
516
|
+
s.WriteMoreIf(&wroteField)
|
|
517
|
+
s.WriteObjectField("complete")
|
|
518
|
+
s.WriteBool(x.Complete)
|
|
519
|
+
}
|
|
520
|
+
if x.Error != "" || s.HasField("error") {
|
|
521
|
+
s.WriteMoreIf(&wroteField)
|
|
522
|
+
s.WriteObjectField("error")
|
|
523
|
+
s.WriteString(x.Error)
|
|
524
|
+
}
|
|
525
|
+
s.WriteObjectEnd()
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
// MarshalJSON marshals the CallData to JSON.
|
|
529
|
+
func (x *CallData) MarshalJSON() ([]byte, error) {
|
|
530
|
+
return json.DefaultMarshalerConfig.Marshal(x)
|
|
531
|
+
}
|
|
532
|
+
|
|
427
533
|
func (m *Packet) MarshalVT() (dAtA []byte, err error) {
|
|
428
534
|
if m == nil {
|
|
429
535
|
return nil, nil
|
|
@@ -479,11 +585,11 @@ func (m *Packet_CallStart) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
|
|
|
479
585
|
return 0, err
|
|
480
586
|
}
|
|
481
587
|
i -= size
|
|
482
|
-
i =
|
|
588
|
+
i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size))
|
|
483
589
|
i--
|
|
484
590
|
dAtA[i] = 0xa
|
|
485
591
|
} else {
|
|
486
|
-
i =
|
|
592
|
+
i = protobuf_go_lite.EncodeVarint(dAtA, i, 0)
|
|
487
593
|
i--
|
|
488
594
|
dAtA[i] = 0xa
|
|
489
595
|
}
|
|
@@ -502,11 +608,11 @@ func (m *Packet_CallData) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
|
|
|
502
608
|
return 0, err
|
|
503
609
|
}
|
|
504
610
|
i -= size
|
|
505
|
-
i =
|
|
611
|
+
i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size))
|
|
506
612
|
i--
|
|
507
613
|
dAtA[i] = 0x12
|
|
508
614
|
} else {
|
|
509
|
-
i =
|
|
615
|
+
i = protobuf_go_lite.EncodeVarint(dAtA, i, 0)
|
|
510
616
|
i--
|
|
511
617
|
dAtA[i] = 0x12
|
|
512
618
|
}
|
|
@@ -572,21 +678,21 @@ func (m *CallStart) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
|
|
|
572
678
|
if len(m.Data) > 0 {
|
|
573
679
|
i -= len(m.Data)
|
|
574
680
|
copy(dAtA[i:], m.Data)
|
|
575
|
-
i =
|
|
681
|
+
i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(len(m.Data)))
|
|
576
682
|
i--
|
|
577
683
|
dAtA[i] = 0x1a
|
|
578
684
|
}
|
|
579
685
|
if len(m.RpcMethod) > 0 {
|
|
580
686
|
i -= len(m.RpcMethod)
|
|
581
687
|
copy(dAtA[i:], m.RpcMethod)
|
|
582
|
-
i =
|
|
688
|
+
i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(len(m.RpcMethod)))
|
|
583
689
|
i--
|
|
584
690
|
dAtA[i] = 0x12
|
|
585
691
|
}
|
|
586
692
|
if len(m.RpcService) > 0 {
|
|
587
693
|
i -= len(m.RpcService)
|
|
588
694
|
copy(dAtA[i:], m.RpcService)
|
|
589
|
-
i =
|
|
695
|
+
i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(len(m.RpcService)))
|
|
590
696
|
i--
|
|
591
697
|
dAtA[i] = 0xa
|
|
592
698
|
}
|
|
@@ -626,7 +732,7 @@ func (m *CallData) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
|
|
|
626
732
|
if len(m.Error) > 0 {
|
|
627
733
|
i -= len(m.Error)
|
|
628
734
|
copy(dAtA[i:], m.Error)
|
|
629
|
-
i =
|
|
735
|
+
i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(len(m.Error)))
|
|
630
736
|
i--
|
|
631
737
|
dAtA[i] = 0x22
|
|
632
738
|
}
|
|
@@ -653,7 +759,7 @@ func (m *CallData) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
|
|
|
653
759
|
if len(m.Data) > 0 {
|
|
654
760
|
i -= len(m.Data)
|
|
655
761
|
copy(dAtA[i:], m.Data)
|
|
656
|
-
i =
|
|
762
|
+
i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(len(m.Data)))
|
|
657
763
|
i--
|
|
658
764
|
dAtA[i] = 0xa
|
|
659
765
|
}
|
|
@@ -681,7 +787,7 @@ func (m *Packet_CallStart) SizeVT() (n int) {
|
|
|
681
787
|
_ = l
|
|
682
788
|
if m.CallStart != nil {
|
|
683
789
|
l = m.CallStart.SizeVT()
|
|
684
|
-
n += 1 + l +
|
|
790
|
+
n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
|
|
685
791
|
} else {
|
|
686
792
|
n += 2
|
|
687
793
|
}
|
|
@@ -695,7 +801,7 @@ func (m *Packet_CallData) SizeVT() (n int) {
|
|
|
695
801
|
_ = l
|
|
696
802
|
if m.CallData != nil {
|
|
697
803
|
l = m.CallData.SizeVT()
|
|
698
|
-
n += 1 + l +
|
|
804
|
+
n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
|
|
699
805
|
} else {
|
|
700
806
|
n += 2
|
|
701
807
|
}
|
|
@@ -718,15 +824,15 @@ func (m *CallStart) SizeVT() (n int) {
|
|
|
718
824
|
_ = l
|
|
719
825
|
l = len(m.RpcService)
|
|
720
826
|
if l > 0 {
|
|
721
|
-
n += 1 + l +
|
|
827
|
+
n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
|
|
722
828
|
}
|
|
723
829
|
l = len(m.RpcMethod)
|
|
724
830
|
if l > 0 {
|
|
725
|
-
n += 1 + l +
|
|
831
|
+
n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
|
|
726
832
|
}
|
|
727
833
|
l = len(m.Data)
|
|
728
834
|
if l > 0 {
|
|
729
|
-
n += 1 + l +
|
|
835
|
+
n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
|
|
730
836
|
}
|
|
731
837
|
if m.DataIsZero {
|
|
732
838
|
n += 2
|
|
@@ -743,7 +849,7 @@ func (m *CallData) SizeVT() (n int) {
|
|
|
743
849
|
_ = l
|
|
744
850
|
l = len(m.Data)
|
|
745
851
|
if l > 0 {
|
|
746
|
-
n += 1 + l +
|
|
852
|
+
n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
|
|
747
853
|
}
|
|
748
854
|
if m.DataIsZero {
|
|
749
855
|
n += 2
|
|
@@ -753,7 +859,7 @@ func (m *CallData) SizeVT() (n int) {
|
|
|
753
859
|
}
|
|
754
860
|
l = len(m.Error)
|
|
755
861
|
if l > 0 {
|
|
756
|
-
n += 1 + l +
|
|
862
|
+
n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
|
|
757
863
|
}
|
|
758
864
|
n += len(m.unknownFields)
|
|
759
865
|
return n
|
|
@@ -767,7 +873,7 @@ func (m *Packet) UnmarshalVT(dAtA []byte) error {
|
|
|
767
873
|
var wire uint64
|
|
768
874
|
for shift := uint(0); ; shift += 7 {
|
|
769
875
|
if shift >= 64 {
|
|
770
|
-
return
|
|
876
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
771
877
|
}
|
|
772
878
|
if iNdEx >= l {
|
|
773
879
|
return io.ErrUnexpectedEOF
|
|
@@ -782,20 +888,20 @@ func (m *Packet) UnmarshalVT(dAtA []byte) error {
|
|
|
782
888
|
fieldNum := int32(wire >> 3)
|
|
783
889
|
wireType := int(wire & 0x7)
|
|
784
890
|
if wireType == 4 {
|
|
785
|
-
return
|
|
891
|
+
return errors.Errorf("proto: Packet: wiretype end group for non-group")
|
|
786
892
|
}
|
|
787
893
|
if fieldNum <= 0 {
|
|
788
|
-
return
|
|
894
|
+
return errors.Errorf("proto: Packet: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
789
895
|
}
|
|
790
896
|
switch fieldNum {
|
|
791
897
|
case 1:
|
|
792
898
|
if wireType != 2 {
|
|
793
|
-
return
|
|
899
|
+
return errors.Errorf("proto: wrong wireType = %d for field CallStart", wireType)
|
|
794
900
|
}
|
|
795
901
|
var msglen int
|
|
796
902
|
for shift := uint(0); ; shift += 7 {
|
|
797
903
|
if shift >= 64 {
|
|
798
|
-
return
|
|
904
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
799
905
|
}
|
|
800
906
|
if iNdEx >= l {
|
|
801
907
|
return io.ErrUnexpectedEOF
|
|
@@ -808,11 +914,11 @@ func (m *Packet) UnmarshalVT(dAtA []byte) error {
|
|
|
808
914
|
}
|
|
809
915
|
}
|
|
810
916
|
if msglen < 0 {
|
|
811
|
-
return
|
|
917
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
812
918
|
}
|
|
813
919
|
postIndex := iNdEx + msglen
|
|
814
920
|
if postIndex < 0 {
|
|
815
|
-
return
|
|
921
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
816
922
|
}
|
|
817
923
|
if postIndex > l {
|
|
818
924
|
return io.ErrUnexpectedEOF
|
|
@@ -831,12 +937,12 @@ func (m *Packet) UnmarshalVT(dAtA []byte) error {
|
|
|
831
937
|
iNdEx = postIndex
|
|
832
938
|
case 2:
|
|
833
939
|
if wireType != 2 {
|
|
834
|
-
return
|
|
940
|
+
return errors.Errorf("proto: wrong wireType = %d for field CallData", wireType)
|
|
835
941
|
}
|
|
836
942
|
var msglen int
|
|
837
943
|
for shift := uint(0); ; shift += 7 {
|
|
838
944
|
if shift >= 64 {
|
|
839
|
-
return
|
|
945
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
840
946
|
}
|
|
841
947
|
if iNdEx >= l {
|
|
842
948
|
return io.ErrUnexpectedEOF
|
|
@@ -849,11 +955,11 @@ func (m *Packet) UnmarshalVT(dAtA []byte) error {
|
|
|
849
955
|
}
|
|
850
956
|
}
|
|
851
957
|
if msglen < 0 {
|
|
852
|
-
return
|
|
958
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
853
959
|
}
|
|
854
960
|
postIndex := iNdEx + msglen
|
|
855
961
|
if postIndex < 0 {
|
|
856
|
-
return
|
|
962
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
857
963
|
}
|
|
858
964
|
if postIndex > l {
|
|
859
965
|
return io.ErrUnexpectedEOF
|
|
@@ -872,12 +978,12 @@ func (m *Packet) UnmarshalVT(dAtA []byte) error {
|
|
|
872
978
|
iNdEx = postIndex
|
|
873
979
|
case 3:
|
|
874
980
|
if wireType != 0 {
|
|
875
|
-
return
|
|
981
|
+
return errors.Errorf("proto: wrong wireType = %d for field CallCancel", wireType)
|
|
876
982
|
}
|
|
877
983
|
var v int
|
|
878
984
|
for shift := uint(0); ; shift += 7 {
|
|
879
985
|
if shift >= 64 {
|
|
880
|
-
return
|
|
986
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
881
987
|
}
|
|
882
988
|
if iNdEx >= l {
|
|
883
989
|
return io.ErrUnexpectedEOF
|
|
@@ -893,12 +999,12 @@ func (m *Packet) UnmarshalVT(dAtA []byte) error {
|
|
|
893
999
|
m.Body = &Packet_CallCancel{CallCancel: b}
|
|
894
1000
|
default:
|
|
895
1001
|
iNdEx = preIndex
|
|
896
|
-
skippy, err :=
|
|
1002
|
+
skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:])
|
|
897
1003
|
if err != nil {
|
|
898
1004
|
return err
|
|
899
1005
|
}
|
|
900
1006
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
901
|
-
return
|
|
1007
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
902
1008
|
}
|
|
903
1009
|
if (iNdEx + skippy) > l {
|
|
904
1010
|
return io.ErrUnexpectedEOF
|
|
@@ -921,7 +1027,7 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
|
|
|
921
1027
|
var wire uint64
|
|
922
1028
|
for shift := uint(0); ; shift += 7 {
|
|
923
1029
|
if shift >= 64 {
|
|
924
|
-
return
|
|
1030
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
925
1031
|
}
|
|
926
1032
|
if iNdEx >= l {
|
|
927
1033
|
return io.ErrUnexpectedEOF
|
|
@@ -936,20 +1042,20 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
|
|
|
936
1042
|
fieldNum := int32(wire >> 3)
|
|
937
1043
|
wireType := int(wire & 0x7)
|
|
938
1044
|
if wireType == 4 {
|
|
939
|
-
return
|
|
1045
|
+
return errors.Errorf("proto: CallStart: wiretype end group for non-group")
|
|
940
1046
|
}
|
|
941
1047
|
if fieldNum <= 0 {
|
|
942
|
-
return
|
|
1048
|
+
return errors.Errorf("proto: CallStart: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
943
1049
|
}
|
|
944
1050
|
switch fieldNum {
|
|
945
1051
|
case 1:
|
|
946
1052
|
if wireType != 2 {
|
|
947
|
-
return
|
|
1053
|
+
return errors.Errorf("proto: wrong wireType = %d for field RpcService", wireType)
|
|
948
1054
|
}
|
|
949
1055
|
var stringLen uint64
|
|
950
1056
|
for shift := uint(0); ; shift += 7 {
|
|
951
1057
|
if shift >= 64 {
|
|
952
|
-
return
|
|
1058
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
953
1059
|
}
|
|
954
1060
|
if iNdEx >= l {
|
|
955
1061
|
return io.ErrUnexpectedEOF
|
|
@@ -963,11 +1069,11 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
|
|
|
963
1069
|
}
|
|
964
1070
|
intStringLen := int(stringLen)
|
|
965
1071
|
if intStringLen < 0 {
|
|
966
|
-
return
|
|
1072
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
967
1073
|
}
|
|
968
1074
|
postIndex := iNdEx + intStringLen
|
|
969
1075
|
if postIndex < 0 {
|
|
970
|
-
return
|
|
1076
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
971
1077
|
}
|
|
972
1078
|
if postIndex > l {
|
|
973
1079
|
return io.ErrUnexpectedEOF
|
|
@@ -976,12 +1082,12 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
|
|
|
976
1082
|
iNdEx = postIndex
|
|
977
1083
|
case 2:
|
|
978
1084
|
if wireType != 2 {
|
|
979
|
-
return
|
|
1085
|
+
return errors.Errorf("proto: wrong wireType = %d for field RpcMethod", wireType)
|
|
980
1086
|
}
|
|
981
1087
|
var stringLen uint64
|
|
982
1088
|
for shift := uint(0); ; shift += 7 {
|
|
983
1089
|
if shift >= 64 {
|
|
984
|
-
return
|
|
1090
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
985
1091
|
}
|
|
986
1092
|
if iNdEx >= l {
|
|
987
1093
|
return io.ErrUnexpectedEOF
|
|
@@ -995,11 +1101,11 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
|
|
|
995
1101
|
}
|
|
996
1102
|
intStringLen := int(stringLen)
|
|
997
1103
|
if intStringLen < 0 {
|
|
998
|
-
return
|
|
1104
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
999
1105
|
}
|
|
1000
1106
|
postIndex := iNdEx + intStringLen
|
|
1001
1107
|
if postIndex < 0 {
|
|
1002
|
-
return
|
|
1108
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
1003
1109
|
}
|
|
1004
1110
|
if postIndex > l {
|
|
1005
1111
|
return io.ErrUnexpectedEOF
|
|
@@ -1008,12 +1114,12 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
|
|
|
1008
1114
|
iNdEx = postIndex
|
|
1009
1115
|
case 3:
|
|
1010
1116
|
if wireType != 2 {
|
|
1011
|
-
return
|
|
1117
|
+
return errors.Errorf("proto: wrong wireType = %d for field Data", wireType)
|
|
1012
1118
|
}
|
|
1013
1119
|
var byteLen int
|
|
1014
1120
|
for shift := uint(0); ; shift += 7 {
|
|
1015
1121
|
if shift >= 64 {
|
|
1016
|
-
return
|
|
1122
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
1017
1123
|
}
|
|
1018
1124
|
if iNdEx >= l {
|
|
1019
1125
|
return io.ErrUnexpectedEOF
|
|
@@ -1026,11 +1132,11 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
|
|
|
1026
1132
|
}
|
|
1027
1133
|
}
|
|
1028
1134
|
if byteLen < 0 {
|
|
1029
|
-
return
|
|
1135
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
1030
1136
|
}
|
|
1031
1137
|
postIndex := iNdEx + byteLen
|
|
1032
1138
|
if postIndex < 0 {
|
|
1033
|
-
return
|
|
1139
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
1034
1140
|
}
|
|
1035
1141
|
if postIndex > l {
|
|
1036
1142
|
return io.ErrUnexpectedEOF
|
|
@@ -1042,12 +1148,12 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
|
|
|
1042
1148
|
iNdEx = postIndex
|
|
1043
1149
|
case 4:
|
|
1044
1150
|
if wireType != 0 {
|
|
1045
|
-
return
|
|
1151
|
+
return errors.Errorf("proto: wrong wireType = %d for field DataIsZero", wireType)
|
|
1046
1152
|
}
|
|
1047
1153
|
var v int
|
|
1048
1154
|
for shift := uint(0); ; shift += 7 {
|
|
1049
1155
|
if shift >= 64 {
|
|
1050
|
-
return
|
|
1156
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
1051
1157
|
}
|
|
1052
1158
|
if iNdEx >= l {
|
|
1053
1159
|
return io.ErrUnexpectedEOF
|
|
@@ -1062,12 +1168,12 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
|
|
|
1062
1168
|
m.DataIsZero = bool(v != 0)
|
|
1063
1169
|
default:
|
|
1064
1170
|
iNdEx = preIndex
|
|
1065
|
-
skippy, err :=
|
|
1171
|
+
skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:])
|
|
1066
1172
|
if err != nil {
|
|
1067
1173
|
return err
|
|
1068
1174
|
}
|
|
1069
1175
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
1070
|
-
return
|
|
1176
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
1071
1177
|
}
|
|
1072
1178
|
if (iNdEx + skippy) > l {
|
|
1073
1179
|
return io.ErrUnexpectedEOF
|
|
@@ -1090,7 +1196,7 @@ func (m *CallData) UnmarshalVT(dAtA []byte) error {
|
|
|
1090
1196
|
var wire uint64
|
|
1091
1197
|
for shift := uint(0); ; shift += 7 {
|
|
1092
1198
|
if shift >= 64 {
|
|
1093
|
-
return
|
|
1199
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
1094
1200
|
}
|
|
1095
1201
|
if iNdEx >= l {
|
|
1096
1202
|
return io.ErrUnexpectedEOF
|
|
@@ -1105,20 +1211,20 @@ func (m *CallData) UnmarshalVT(dAtA []byte) error {
|
|
|
1105
1211
|
fieldNum := int32(wire >> 3)
|
|
1106
1212
|
wireType := int(wire & 0x7)
|
|
1107
1213
|
if wireType == 4 {
|
|
1108
|
-
return
|
|
1214
|
+
return errors.Errorf("proto: CallData: wiretype end group for non-group")
|
|
1109
1215
|
}
|
|
1110
1216
|
if fieldNum <= 0 {
|
|
1111
|
-
return
|
|
1217
|
+
return errors.Errorf("proto: CallData: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
1112
1218
|
}
|
|
1113
1219
|
switch fieldNum {
|
|
1114
1220
|
case 1:
|
|
1115
1221
|
if wireType != 2 {
|
|
1116
|
-
return
|
|
1222
|
+
return errors.Errorf("proto: wrong wireType = %d for field Data", wireType)
|
|
1117
1223
|
}
|
|
1118
1224
|
var byteLen int
|
|
1119
1225
|
for shift := uint(0); ; shift += 7 {
|
|
1120
1226
|
if shift >= 64 {
|
|
1121
|
-
return
|
|
1227
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
1122
1228
|
}
|
|
1123
1229
|
if iNdEx >= l {
|
|
1124
1230
|
return io.ErrUnexpectedEOF
|
|
@@ -1131,11 +1237,11 @@ func (m *CallData) UnmarshalVT(dAtA []byte) error {
|
|
|
1131
1237
|
}
|
|
1132
1238
|
}
|
|
1133
1239
|
if byteLen < 0 {
|
|
1134
|
-
return
|
|
1240
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
1135
1241
|
}
|
|
1136
1242
|
postIndex := iNdEx + byteLen
|
|
1137
1243
|
if postIndex < 0 {
|
|
1138
|
-
return
|
|
1244
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
1139
1245
|
}
|
|
1140
1246
|
if postIndex > l {
|
|
1141
1247
|
return io.ErrUnexpectedEOF
|
|
@@ -1147,12 +1253,12 @@ func (m *CallData) UnmarshalVT(dAtA []byte) error {
|
|
|
1147
1253
|
iNdEx = postIndex
|
|
1148
1254
|
case 2:
|
|
1149
1255
|
if wireType != 0 {
|
|
1150
|
-
return
|
|
1256
|
+
return errors.Errorf("proto: wrong wireType = %d for field DataIsZero", wireType)
|
|
1151
1257
|
}
|
|
1152
1258
|
var v int
|
|
1153
1259
|
for shift := uint(0); ; shift += 7 {
|
|
1154
1260
|
if shift >= 64 {
|
|
1155
|
-
return
|
|
1261
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
1156
1262
|
}
|
|
1157
1263
|
if iNdEx >= l {
|
|
1158
1264
|
return io.ErrUnexpectedEOF
|
|
@@ -1167,12 +1273,12 @@ func (m *CallData) UnmarshalVT(dAtA []byte) error {
|
|
|
1167
1273
|
m.DataIsZero = bool(v != 0)
|
|
1168
1274
|
case 3:
|
|
1169
1275
|
if wireType != 0 {
|
|
1170
|
-
return
|
|
1276
|
+
return errors.Errorf("proto: wrong wireType = %d for field Complete", wireType)
|
|
1171
1277
|
}
|
|
1172
1278
|
var v int
|
|
1173
1279
|
for shift := uint(0); ; shift += 7 {
|
|
1174
1280
|
if shift >= 64 {
|
|
1175
|
-
return
|
|
1281
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
1176
1282
|
}
|
|
1177
1283
|
if iNdEx >= l {
|
|
1178
1284
|
return io.ErrUnexpectedEOF
|
|
@@ -1187,12 +1293,12 @@ func (m *CallData) UnmarshalVT(dAtA []byte) error {
|
|
|
1187
1293
|
m.Complete = bool(v != 0)
|
|
1188
1294
|
case 4:
|
|
1189
1295
|
if wireType != 2 {
|
|
1190
|
-
return
|
|
1296
|
+
return errors.Errorf("proto: wrong wireType = %d for field Error", wireType)
|
|
1191
1297
|
}
|
|
1192
1298
|
var stringLen uint64
|
|
1193
1299
|
for shift := uint(0); ; shift += 7 {
|
|
1194
1300
|
if shift >= 64 {
|
|
1195
|
-
return
|
|
1301
|
+
return protobuf_go_lite.ErrIntOverflow
|
|
1196
1302
|
}
|
|
1197
1303
|
if iNdEx >= l {
|
|
1198
1304
|
return io.ErrUnexpectedEOF
|
|
@@ -1206,11 +1312,11 @@ func (m *CallData) UnmarshalVT(dAtA []byte) error {
|
|
|
1206
1312
|
}
|
|
1207
1313
|
intStringLen := int(stringLen)
|
|
1208
1314
|
if intStringLen < 0 {
|
|
1209
|
-
return
|
|
1315
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
1210
1316
|
}
|
|
1211
1317
|
postIndex := iNdEx + intStringLen
|
|
1212
1318
|
if postIndex < 0 {
|
|
1213
|
-
return
|
|
1319
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
1214
1320
|
}
|
|
1215
1321
|
if postIndex > l {
|
|
1216
1322
|
return io.ErrUnexpectedEOF
|
|
@@ -1219,12 +1325,12 @@ func (m *CallData) UnmarshalVT(dAtA []byte) error {
|
|
|
1219
1325
|
iNdEx = postIndex
|
|
1220
1326
|
default:
|
|
1221
1327
|
iNdEx = preIndex
|
|
1222
|
-
skippy, err :=
|
|
1328
|
+
skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:])
|
|
1223
1329
|
if err != nil {
|
|
1224
1330
|
return err
|
|
1225
1331
|
}
|
|
1226
1332
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
1227
|
-
return
|
|
1333
|
+
return protobuf_go_lite.ErrInvalidLength
|
|
1228
1334
|
}
|
|
1229
1335
|
if (iNdEx + skippy) > l {
|
|
1230
1336
|
return io.ErrUnexpectedEOF
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
// Code generated by protoc-gen-srpc. DO NOT EDIT.
|
|
2
|
-
// protoc-gen-srpc version: v0.0.0-20220611014014-aa9dc5523865
|
|
3
|
-
// source: github.com/aperturerobotics/starpc/integration/integration.proto
|
|
4
|
-
|
|
5
|
-
package main
|
|
6
|
-
|
|
7
|
-
import (
|
|
8
|
-
context "context"
|
|
9
|
-
|
|
10
|
-
rpcstream "github.com/aperturerobotics/starpc/rpcstream"
|
|
11
|
-
srpc "github.com/aperturerobotics/starpc/srpc"
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
type SRPCIntegrationServiceClient interface {
|
|
15
|
-
SRPCClient() srpc.Client
|
|
16
|
-
|
|
17
|
-
RpcStream(ctx context.Context) (SRPCIntegrationService_RpcStreamClient, error)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
type srpcIntegrationServiceClient struct {
|
|
21
|
-
cc srpc.Client
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
func NewSRPCIntegrationServiceClient(cc srpc.Client) SRPCIntegrationServiceClient {
|
|
25
|
-
return &srpcIntegrationServiceClient{cc}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
func (c *srpcIntegrationServiceClient) SRPCClient() srpc.Client { return c.cc }
|
|
29
|
-
|
|
30
|
-
func (c *srpcIntegrationServiceClient) RpcStream(ctx context.Context) (SRPCIntegrationService_RpcStreamClient, error) {
|
|
31
|
-
stream, err := c.cc.NewStream(ctx, "main.IntegrationService", "RpcStream", nil)
|
|
32
|
-
if err != nil {
|
|
33
|
-
return nil, err
|
|
34
|
-
}
|
|
35
|
-
strm := &srpcIntegrationService_RpcStreamClient{stream}
|
|
36
|
-
return strm, nil
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
type SRPCIntegrationService_RpcStreamClient interface {
|
|
40
|
-
srpc.Stream
|
|
41
|
-
Send(*rpcstream.RpcStreamPacket) error
|
|
42
|
-
Recv() (*rpcstream.RpcStreamPacket, error)
|
|
43
|
-
RecvTo(*rpcstream.RpcStreamPacket) error
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
type srpcIntegrationService_RpcStreamClient struct {
|
|
47
|
-
srpc.Stream
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
func (x *srpcIntegrationService_RpcStreamClient) Send(m *rpcstream.RpcStreamPacket) error {
|
|
51
|
-
return x.MsgSend(m)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
func (x *srpcIntegrationService_RpcStreamClient) Recv() (*rpcstream.RpcStreamPacket, error) {
|
|
55
|
-
m := new(rpcstream.RpcStreamPacket)
|
|
56
|
-
if err := x.MsgRecv(m); err != nil {
|
|
57
|
-
return nil, err
|
|
58
|
-
}
|
|
59
|
-
return m, nil
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
func (x *srpcIntegrationService_RpcStreamClient) RecvTo(m *rpcstream.RpcStreamPacket) error {
|
|
63
|
-
return x.MsgRecv(m)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
type SRPCIntegrationServiceServer interface {
|
|
67
|
-
RpcStream(SRPCIntegrationService_RpcStreamStream) error
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
type SRPCIntegrationServiceUnimplementedServer struct{}
|
|
71
|
-
|
|
72
|
-
func (s *SRPCIntegrationServiceUnimplementedServer) RpcStream(SRPCIntegrationService_RpcStreamStream) error {
|
|
73
|
-
return srpc.ErrUnimplemented
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const SRPCIntegrationServiceServiceID = "main.IntegrationService"
|
|
77
|
-
|
|
78
|
-
type SRPCIntegrationServiceHandler struct {
|
|
79
|
-
impl SRPCIntegrationServiceServer
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
func (SRPCIntegrationServiceHandler) GetServiceID() string { return SRPCIntegrationServiceServiceID }
|
|
83
|
-
|
|
84
|
-
func (SRPCIntegrationServiceHandler) GetMethodIDs() []string {
|
|
85
|
-
return []string{
|
|
86
|
-
"RpcStream",
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
func (d *SRPCIntegrationServiceHandler) InvokeMethod(
|
|
91
|
-
serviceID, methodID string,
|
|
92
|
-
strm srpc.Stream,
|
|
93
|
-
) (bool, error) {
|
|
94
|
-
if serviceID != "" && serviceID != d.GetServiceID() {
|
|
95
|
-
return false, nil
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
switch methodID {
|
|
99
|
-
case "RpcStream":
|
|
100
|
-
return true, d.InvokeMethod_RpcStream(d.impl, strm)
|
|
101
|
-
default:
|
|
102
|
-
return false, nil
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
func (SRPCIntegrationServiceHandler) InvokeMethod_RpcStream(impl SRPCIntegrationServiceServer, strm srpc.Stream) error {
|
|
107
|
-
clientStrm := &srpcIntegrationService_RpcStreamStream{strm}
|
|
108
|
-
return impl.RpcStream(clientStrm)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
func SRPCRegisterIntegrationService(mux srpc.Mux, impl SRPCIntegrationServiceServer) error {
|
|
112
|
-
return mux.Register(&SRPCIntegrationServiceHandler{impl: impl})
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
type SRPCIntegrationService_RpcStreamStream interface {
|
|
116
|
-
srpc.Stream
|
|
117
|
-
Send(*rpcstream.RpcStreamPacket) error
|
|
118
|
-
Recv() (*rpcstream.RpcStreamPacket, error)
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
type srpcIntegrationService_RpcStreamStream struct {
|
|
122
|
-
srpc.Stream
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
func (x *srpcIntegrationService_RpcStreamStream) Send(m *rpcstream.RpcStreamPacket) error {
|
|
126
|
-
return x.MsgSend(m)
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
func (x *srpcIntegrationService_RpcStreamStream) Recv() (*rpcstream.RpcStreamPacket, error) {
|
|
130
|
-
m := new(rpcstream.RpcStreamPacket)
|
|
131
|
-
if err := x.MsgRecv(m); err != nil {
|
|
132
|
-
return nil, err
|
|
133
|
-
}
|
|
134
|
-
return m, nil
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
func (x *srpcIntegrationService_RpcStreamStream) RecvTo(m *rpcstream.RpcStreamPacket) error {
|
|
138
|
-
return x.MsgRecv(m)
|
|
139
|
-
}
|