starpc 0.22.6 → 0.22.8

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.
@@ -44,7 +44,7 @@ export class Client {
44
44
  .then(async (call) => {
45
45
  return writeToPushable(call.rpcDataSource, serverData);
46
46
  })
47
- .catch(err => serverData.end(err));
47
+ .catch((err) => serverData.end(err));
48
48
  return serverData;
49
49
  }
50
50
  // bidirectionalStreamingRequest starts a two-way streaming request.
@@ -63,7 +63,7 @@ export class Client {
63
63
  serverData.end(err);
64
64
  }
65
65
  })
66
- .catch(err => serverData.end(err));
66
+ .catch((err) => serverData.end(err));
67
67
  return serverData;
68
68
  }
69
69
  // startRpc is a common utility function to begin a rpc call.
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-go. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-go v1.31.0-devel
4
- // protoc v4.25.1
3
+ // protoc-gen-go v1.32.0-devel
4
+ // protoc v4.25.2
5
5
  // source: github.com/aperturerobotics/starpc/e2e/mock/mock.proto
6
6
 
7
7
  package e2e_mock
@@ -1,5 +1,5 @@
1
1
  // Code generated by protoc-gen-srpc. DO NOT EDIT.
2
- // protoc-gen-srpc version: v0.19.1
2
+ // protoc-gen-srpc version: v0.22.7
3
3
  // source: github.com/aperturerobotics/starpc/e2e/mock/mock.proto
4
4
 
5
5
  package e2e_mock
@@ -1,5 +1,5 @@
1
1
  // Code generated by protoc-gen-go-vtproto. DO NOT EDIT.
2
- // protoc-gen-go-vtproto version: v0.4.0
2
+ // protoc-gen-go-vtproto version: v0.6.0
3
3
  // source: github.com/aperturerobotics/starpc/e2e/mock/mock.proto
4
4
 
5
5
  package e2e_mock
@@ -7,8 +7,8 @@ package e2e_mock
7
7
  import (
8
8
  fmt "fmt"
9
9
  io "io"
10
- bits "math/bits"
11
10
 
11
+ protohelpers "github.com/planetscale/vtprotobuf/protohelpers"
12
12
  proto "google.golang.org/protobuf/proto"
13
13
  protoimpl "google.golang.org/protobuf/runtime/protoimpl"
14
14
  )
@@ -24,9 +24,8 @@ func (m *MockMsg) CloneVT() *MockMsg {
24
24
  if m == nil {
25
25
  return (*MockMsg)(nil)
26
26
  }
27
- r := &MockMsg{
28
- Body: m.Body,
29
- }
27
+ r := new(MockMsg)
28
+ r.Body = m.Body
30
29
  if len(m.unknownFields) > 0 {
31
30
  r.unknownFields = make([]byte, len(m.unknownFields))
32
31
  copy(r.unknownFields, m.unknownFields)
@@ -90,24 +89,13 @@ func (m *MockMsg) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
90
89
  if len(m.Body) > 0 {
91
90
  i -= len(m.Body)
92
91
  copy(dAtA[i:], m.Body)
93
- i = encodeVarint(dAtA, i, uint64(len(m.Body)))
92
+ i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Body)))
94
93
  i--
95
94
  dAtA[i] = 0xa
96
95
  }
97
96
  return len(dAtA) - i, nil
98
97
  }
99
98
 
100
- func encodeVarint(dAtA []byte, offset int, v uint64) int {
101
- offset -= sov(v)
102
- base := offset
103
- for v >= 1<<7 {
104
- dAtA[offset] = uint8(v&0x7f | 0x80)
105
- v >>= 7
106
- offset++
107
- }
108
- dAtA[offset] = uint8(v)
109
- return base
110
- }
111
99
  func (m *MockMsg) SizeVT() (n int) {
112
100
  if m == nil {
113
101
  return 0
@@ -116,18 +104,12 @@ func (m *MockMsg) SizeVT() (n int) {
116
104
  _ = l
117
105
  l = len(m.Body)
118
106
  if l > 0 {
119
- n += 1 + l + sov(uint64(l))
107
+ n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
120
108
  }
121
109
  n += len(m.unknownFields)
122
110
  return n
123
111
  }
124
112
 
125
- func sov(x uint64) (n int) {
126
- return (bits.Len64(x|1) + 6) / 7
127
- }
128
- func soz(x uint64) (n int) {
129
- return sov(uint64((x << 1) ^ uint64((int64(x) >> 63))))
130
- }
131
113
  func (m *MockMsg) UnmarshalVT(dAtA []byte) error {
132
114
  l := len(dAtA)
133
115
  iNdEx := 0
@@ -136,7 +118,7 @@ func (m *MockMsg) UnmarshalVT(dAtA []byte) error {
136
118
  var wire uint64
137
119
  for shift := uint(0); ; shift += 7 {
138
120
  if shift >= 64 {
139
- return ErrIntOverflow
121
+ return protohelpers.ErrIntOverflow
140
122
  }
141
123
  if iNdEx >= l {
142
124
  return io.ErrUnexpectedEOF
@@ -164,7 +146,7 @@ func (m *MockMsg) UnmarshalVT(dAtA []byte) error {
164
146
  var stringLen uint64
165
147
  for shift := uint(0); ; shift += 7 {
166
148
  if shift >= 64 {
167
- return ErrIntOverflow
149
+ return protohelpers.ErrIntOverflow
168
150
  }
169
151
  if iNdEx >= l {
170
152
  return io.ErrUnexpectedEOF
@@ -178,11 +160,11 @@ func (m *MockMsg) UnmarshalVT(dAtA []byte) error {
178
160
  }
179
161
  intStringLen := int(stringLen)
180
162
  if intStringLen < 0 {
181
- return ErrInvalidLength
163
+ return protohelpers.ErrInvalidLength
182
164
  }
183
165
  postIndex := iNdEx + intStringLen
184
166
  if postIndex < 0 {
185
- return ErrInvalidLength
167
+ return protohelpers.ErrInvalidLength
186
168
  }
187
169
  if postIndex > l {
188
170
  return io.ErrUnexpectedEOF
@@ -191,12 +173,12 @@ func (m *MockMsg) UnmarshalVT(dAtA []byte) error {
191
173
  iNdEx = postIndex
192
174
  default:
193
175
  iNdEx = preIndex
194
- skippy, err := skip(dAtA[iNdEx:])
176
+ skippy, err := protohelpers.Skip(dAtA[iNdEx:])
195
177
  if err != nil {
196
178
  return err
197
179
  }
198
180
  if (skippy < 0) || (iNdEx+skippy) < 0 {
199
- return ErrInvalidLength
181
+ return protohelpers.ErrInvalidLength
200
182
  }
201
183
  if (iNdEx + skippy) > l {
202
184
  return io.ErrUnexpectedEOF
@@ -211,88 +193,3 @@ func (m *MockMsg) UnmarshalVT(dAtA []byte) error {
211
193
  }
212
194
  return nil
213
195
  }
214
-
215
- func skip(dAtA []byte) (n int, err error) {
216
- l := len(dAtA)
217
- iNdEx := 0
218
- depth := 0
219
- for iNdEx < l {
220
- var wire uint64
221
- for shift := uint(0); ; shift += 7 {
222
- if shift >= 64 {
223
- return 0, ErrIntOverflow
224
- }
225
- if iNdEx >= l {
226
- return 0, io.ErrUnexpectedEOF
227
- }
228
- b := dAtA[iNdEx]
229
- iNdEx++
230
- wire |= (uint64(b) & 0x7F) << shift
231
- if b < 0x80 {
232
- break
233
- }
234
- }
235
- wireType := int(wire & 0x7)
236
- switch wireType {
237
- case 0:
238
- for shift := uint(0); ; shift += 7 {
239
- if shift >= 64 {
240
- return 0, ErrIntOverflow
241
- }
242
- if iNdEx >= l {
243
- return 0, io.ErrUnexpectedEOF
244
- }
245
- iNdEx++
246
- if dAtA[iNdEx-1] < 0x80 {
247
- break
248
- }
249
- }
250
- case 1:
251
- iNdEx += 8
252
- case 2:
253
- var length int
254
- for shift := uint(0); ; shift += 7 {
255
- if shift >= 64 {
256
- return 0, ErrIntOverflow
257
- }
258
- if iNdEx >= l {
259
- return 0, io.ErrUnexpectedEOF
260
- }
261
- b := dAtA[iNdEx]
262
- iNdEx++
263
- length |= (int(b) & 0x7F) << shift
264
- if b < 0x80 {
265
- break
266
- }
267
- }
268
- if length < 0 {
269
- return 0, ErrInvalidLength
270
- }
271
- iNdEx += length
272
- case 3:
273
- depth++
274
- case 4:
275
- if depth == 0 {
276
- return 0, ErrUnexpectedEndOfGroup
277
- }
278
- depth--
279
- case 5:
280
- iNdEx += 4
281
- default:
282
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
283
- }
284
- if iNdEx < 0 {
285
- return 0, ErrInvalidLength
286
- }
287
- if depth == 0 {
288
- return iNdEx, nil
289
- }
290
- }
291
- return 0, io.ErrUnexpectedEOF
292
- }
293
-
294
- var (
295
- ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling")
296
- ErrIntOverflow = fmt.Errorf("proto: integer overflow")
297
- ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
298
- )
package/echo/echo.pb.go CHANGED
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-go. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-go v1.31.0-devel
4
- // protoc v4.25.1
3
+ // protoc-gen-go v1.32.0-devel
4
+ // protoc v4.25.2
5
5
  // source: github.com/aperturerobotics/starpc/echo/echo.proto
6
6
 
7
7
  package echo
@@ -1,5 +1,5 @@
1
1
  // Code generated by protoc-gen-srpc. DO NOT EDIT.
2
- // protoc-gen-srpc version: v0.19.1
2
+ // protoc-gen-srpc version: v0.22.7
3
3
  // source: github.com/aperturerobotics/starpc/echo/echo.proto
4
4
 
5
5
  package echo
@@ -1,5 +1,5 @@
1
1
  // Code generated by protoc-gen-go-vtproto. DO NOT EDIT.
2
- // protoc-gen-go-vtproto version: v0.4.0
2
+ // protoc-gen-go-vtproto version: v0.6.0
3
3
  // source: github.com/aperturerobotics/starpc/echo/echo.proto
4
4
 
5
5
  package echo
@@ -7,8 +7,8 @@ package echo
7
7
  import (
8
8
  fmt "fmt"
9
9
  io "io"
10
- bits "math/bits"
11
10
 
11
+ protohelpers "github.com/planetscale/vtprotobuf/protohelpers"
12
12
  proto "google.golang.org/protobuf/proto"
13
13
  protoimpl "google.golang.org/protobuf/runtime/protoimpl"
14
14
  )
@@ -24,9 +24,8 @@ func (m *EchoMsg) CloneVT() *EchoMsg {
24
24
  if m == nil {
25
25
  return (*EchoMsg)(nil)
26
26
  }
27
- r := &EchoMsg{
28
- Body: m.Body,
29
- }
27
+ r := new(EchoMsg)
28
+ r.Body = m.Body
30
29
  if len(m.unknownFields) > 0 {
31
30
  r.unknownFields = make([]byte, len(m.unknownFields))
32
31
  copy(r.unknownFields, m.unknownFields)
@@ -90,24 +89,13 @@ func (m *EchoMsg) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
90
89
  if len(m.Body) > 0 {
91
90
  i -= len(m.Body)
92
91
  copy(dAtA[i:], m.Body)
93
- i = encodeVarint(dAtA, i, uint64(len(m.Body)))
92
+ i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Body)))
94
93
  i--
95
94
  dAtA[i] = 0xa
96
95
  }
97
96
  return len(dAtA) - i, nil
98
97
  }
99
98
 
100
- func encodeVarint(dAtA []byte, offset int, v uint64) int {
101
- offset -= sov(v)
102
- base := offset
103
- for v >= 1<<7 {
104
- dAtA[offset] = uint8(v&0x7f | 0x80)
105
- v >>= 7
106
- offset++
107
- }
108
- dAtA[offset] = uint8(v)
109
- return base
110
- }
111
99
  func (m *EchoMsg) SizeVT() (n int) {
112
100
  if m == nil {
113
101
  return 0
@@ -116,18 +104,12 @@ func (m *EchoMsg) SizeVT() (n int) {
116
104
  _ = l
117
105
  l = len(m.Body)
118
106
  if l > 0 {
119
- n += 1 + l + sov(uint64(l))
107
+ n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
120
108
  }
121
109
  n += len(m.unknownFields)
122
110
  return n
123
111
  }
124
112
 
125
- func sov(x uint64) (n int) {
126
- return (bits.Len64(x|1) + 6) / 7
127
- }
128
- func soz(x uint64) (n int) {
129
- return sov(uint64((x << 1) ^ uint64((int64(x) >> 63))))
130
- }
131
113
  func (m *EchoMsg) UnmarshalVT(dAtA []byte) error {
132
114
  l := len(dAtA)
133
115
  iNdEx := 0
@@ -136,7 +118,7 @@ func (m *EchoMsg) UnmarshalVT(dAtA []byte) error {
136
118
  var wire uint64
137
119
  for shift := uint(0); ; shift += 7 {
138
120
  if shift >= 64 {
139
- return ErrIntOverflow
121
+ return protohelpers.ErrIntOverflow
140
122
  }
141
123
  if iNdEx >= l {
142
124
  return io.ErrUnexpectedEOF
@@ -164,7 +146,7 @@ func (m *EchoMsg) UnmarshalVT(dAtA []byte) error {
164
146
  var stringLen uint64
165
147
  for shift := uint(0); ; shift += 7 {
166
148
  if shift >= 64 {
167
- return ErrIntOverflow
149
+ return protohelpers.ErrIntOverflow
168
150
  }
169
151
  if iNdEx >= l {
170
152
  return io.ErrUnexpectedEOF
@@ -178,11 +160,11 @@ func (m *EchoMsg) UnmarshalVT(dAtA []byte) error {
178
160
  }
179
161
  intStringLen := int(stringLen)
180
162
  if intStringLen < 0 {
181
- return ErrInvalidLength
163
+ return protohelpers.ErrInvalidLength
182
164
  }
183
165
  postIndex := iNdEx + intStringLen
184
166
  if postIndex < 0 {
185
- return ErrInvalidLength
167
+ return protohelpers.ErrInvalidLength
186
168
  }
187
169
  if postIndex > l {
188
170
  return io.ErrUnexpectedEOF
@@ -191,12 +173,12 @@ func (m *EchoMsg) UnmarshalVT(dAtA []byte) error {
191
173
  iNdEx = postIndex
192
174
  default:
193
175
  iNdEx = preIndex
194
- skippy, err := skip(dAtA[iNdEx:])
176
+ skippy, err := protohelpers.Skip(dAtA[iNdEx:])
195
177
  if err != nil {
196
178
  return err
197
179
  }
198
180
  if (skippy < 0) || (iNdEx+skippy) < 0 {
199
- return ErrInvalidLength
181
+ return protohelpers.ErrInvalidLength
200
182
  }
201
183
  if (iNdEx + skippy) > l {
202
184
  return io.ErrUnexpectedEOF
@@ -211,88 +193,3 @@ func (m *EchoMsg) UnmarshalVT(dAtA []byte) error {
211
193
  }
212
194
  return nil
213
195
  }
214
-
215
- func skip(dAtA []byte) (n int, err error) {
216
- l := len(dAtA)
217
- iNdEx := 0
218
- depth := 0
219
- for iNdEx < l {
220
- var wire uint64
221
- for shift := uint(0); ; shift += 7 {
222
- if shift >= 64 {
223
- return 0, ErrIntOverflow
224
- }
225
- if iNdEx >= l {
226
- return 0, io.ErrUnexpectedEOF
227
- }
228
- b := dAtA[iNdEx]
229
- iNdEx++
230
- wire |= (uint64(b) & 0x7F) << shift
231
- if b < 0x80 {
232
- break
233
- }
234
- }
235
- wireType := int(wire & 0x7)
236
- switch wireType {
237
- case 0:
238
- for shift := uint(0); ; shift += 7 {
239
- if shift >= 64 {
240
- return 0, ErrIntOverflow
241
- }
242
- if iNdEx >= l {
243
- return 0, io.ErrUnexpectedEOF
244
- }
245
- iNdEx++
246
- if dAtA[iNdEx-1] < 0x80 {
247
- break
248
- }
249
- }
250
- case 1:
251
- iNdEx += 8
252
- case 2:
253
- var length int
254
- for shift := uint(0); ; shift += 7 {
255
- if shift >= 64 {
256
- return 0, ErrIntOverflow
257
- }
258
- if iNdEx >= l {
259
- return 0, io.ErrUnexpectedEOF
260
- }
261
- b := dAtA[iNdEx]
262
- iNdEx++
263
- length |= (int(b) & 0x7F) << shift
264
- if b < 0x80 {
265
- break
266
- }
267
- }
268
- if length < 0 {
269
- return 0, ErrInvalidLength
270
- }
271
- iNdEx += length
272
- case 3:
273
- depth++
274
- case 4:
275
- if depth == 0 {
276
- return 0, ErrUnexpectedEndOfGroup
277
- }
278
- depth--
279
- case 5:
280
- iNdEx += 4
281
- default:
282
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
283
- }
284
- if iNdEx < 0 {
285
- return 0, ErrInvalidLength
286
- }
287
- if depth == 0 {
288
- return iNdEx, nil
289
- }
290
- }
291
- return 0, io.ErrUnexpectedEOF
292
- }
293
-
294
- var (
295
- ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling")
296
- ErrIntOverflow = fmt.Errorf("proto: integer overflow")
297
- ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
298
- )
package/go.mod CHANGED
@@ -9,12 +9,14 @@ require (
9
9
  )
10
10
 
11
11
  require (
12
- github.com/aperturerobotics/util v1.11.3 // latest
12
+ github.com/aperturerobotics/util v1.13.2 // latest
13
13
  github.com/libp2p/go-libp2p v0.32.2 // latest
14
- github.com/libp2p/go-yamux/v4 v4.0.2-0.20231213140704-4c5812896512 // master
14
+ github.com/libp2p/go-yamux/v4 v4.0.2-0.20240206065824-7222fbc3459d // master
15
15
  github.com/sirupsen/logrus v1.9.3 // latest
16
16
  )
17
17
 
18
+ require github.com/planetscale/vtprotobuf v0.6.0
19
+
18
20
  require (
19
21
  github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
20
22
  github.com/ipfs/go-cid v0.4.1 // indirect
package/go.sum CHANGED
@@ -1,14 +1,14 @@
1
- github.com/aperturerobotics/util v1.11.0 h1:SpbpNw23DACYkiZ9cCauP98Nwg73T04YkfD4E/WZ2Hc=
2
- github.com/aperturerobotics/util v1.11.0/go.mod h1:d84OAQAGXCpl7JOBstnal91Lm6nKgk+vBgtHPgxBYrQ=
3
- github.com/aperturerobotics/util v1.11.3 h1:qg7TTe1L/rtoENssNKwz+VMeA3CCDVQ5SnYWig6WMOk=
4
- github.com/aperturerobotics/util v1.11.3/go.mod h1:d84OAQAGXCpl7JOBstnal91Lm6nKgk+vBgtHPgxBYrQ=
1
+ github.com/aperturerobotics/util v1.13.2 h1:MTe8MO+Tfo9d3Z4Zi6Akm//rIymy5gyoAOIEHQdFrOU=
2
+ github.com/aperturerobotics/util v1.13.2/go.mod h1:d84OAQAGXCpl7JOBstnal91Lm6nKgk+vBgtHPgxBYrQ=
5
3
  github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
6
4
  github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
7
5
  github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
8
6
  github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
7
+ github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
9
8
  github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs=
10
9
  github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
11
10
  github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
11
+ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
12
12
  github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
13
13
  github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk=
14
14
  github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
@@ -18,8 +18,9 @@ github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QT
18
18
  github.com/libp2p/go-libp2p v0.32.2 h1:s8GYN4YJzgUoyeYNPdW7JZeZ5Ee31iNaIBfGYMAY4FQ=
19
19
  github.com/libp2p/go-libp2p v0.32.2/go.mod h1:E0LKe+diV/ZVJVnOJby8VC5xzHF0660osg71skcxJvk=
20
20
  github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA=
21
- github.com/libp2p/go-yamux/v4 v4.0.2-0.20231213140704-4c5812896512 h1:QvLt0Hr2Qmex+9wrv/tBeDsZ5AutKdy6ZF7pGTyEeQY=
22
- github.com/libp2p/go-yamux/v4 v4.0.2-0.20231213140704-4c5812896512/go.mod h1:OsNeDpmxccy93bUsruLEdsqIuO1VbBOFsQ4c4GfwenE=
21
+ github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg=
22
+ github.com/libp2p/go-yamux/v4 v4.0.2-0.20240206065824-7222fbc3459d h1:Lag2VlBLRAiYKMnbIJGSDFmfSIoaeQRZ3wJXt91ZWV8=
23
+ github.com/libp2p/go-yamux/v4 v4.0.2-0.20240206065824-7222fbc3459d/go.mod h1:OsNeDpmxccy93bUsruLEdsqIuO1VbBOFsQ4c4GfwenE=
23
24
  github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
24
25
  github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
25
26
  github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
@@ -42,6 +43,8 @@ github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/n
42
43
  github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU=
43
44
  github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
44
45
  github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
46
+ github.com/planetscale/vtprotobuf v0.6.0 h1:nBeETjudeJ5ZgBHUz1fVHvbqUKnYOXNhsIEabROxmNA=
47
+ github.com/planetscale/vtprotobuf v0.6.0/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8=
45
48
  github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
46
49
  github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
47
50
  github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
@@ -51,6 +54,7 @@ github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2
51
54
  github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
52
55
  github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
53
56
  github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
57
+ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
54
58
  golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
55
59
  golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
56
60
  golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
@@ -64,6 +68,7 @@ google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHh
64
68
  gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
65
69
  gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
66
70
  gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
71
+ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
67
72
  lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI=
68
73
  lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k=
69
74
  nhooyr.io/websocket v1.8.10 h1:mv4p+MnGrLDcPlBoWsvPP7XCzTYMXP9F9eIGoKbgx7Q=
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starpc",
3
- "version": "0.22.6",
3
+ "version": "0.22.8",
4
4
  "description": "Streaming protobuf RPC service protocol over any two-way channel.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -61,11 +61,11 @@
61
61
  "singleQuote": true
62
62
  },
63
63
  "devDependencies": {
64
- "@aperturerobotics/ts-common": "^0.8.2",
64
+ "@aperturerobotics/ts-common": "^0.8.3",
65
65
  "bufferutil": "^4.0.7",
66
66
  "depcheck": "^1.4.6",
67
- "esbuild": "^0.19.11",
68
- "prettier": "^3.0.3",
67
+ "esbuild": "^0.20.0",
68
+ "prettier": "^3.2.4",
69
69
  "rimraf": "^5.0.1",
70
70
  "ts-poet": "6.6.0",
71
71
  "ts-proto": "^1.166.1",
@@ -87,7 +87,7 @@
87
87
  "long": "^5.2.3",
88
88
  "memoize-one": "^6.0.0",
89
89
  "patch-package": "^8.0.0",
90
- "protobufjs": "^7.2.5",
90
+ "protobufjs": "^7.2.6",
91
91
  "uint8arraylist": "^2.4.7",
92
92
  "ws": "^8.15.1"
93
93
  }
package/srpc/client.ts CHANGED
@@ -70,7 +70,7 @@ export class Client implements TsProtoRpc {
70
70
  .then(async (call) => {
71
71
  return writeToPushable(call.rpcDataSource, serverData)
72
72
  })
73
- .catch(err => serverData.end(err))
73
+ .catch((err) => serverData.end(err))
74
74
  return serverData
75
75
  }
76
76
 
@@ -94,7 +94,7 @@ export class Client implements TsProtoRpc {
94
94
  serverData.end(err as Error)
95
95
  }
96
96
  })
97
- .catch(err => serverData.end(err))
97
+ .catch((err) => serverData.end(err))
98
98
  return serverData
99
99
  }
100
100
 
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-go. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-go v1.31.0-devel
4
- // protoc v4.25.1
3
+ // protoc-gen-go v1.32.0-devel
4
+ // protoc v4.25.2
5
5
  // source: github.com/aperturerobotics/starpc/srpc/rpcproto.proto
6
6
 
7
7
  package srpc
@@ -1,5 +1,5 @@
1
1
  // Code generated by protoc-gen-go-vtproto. DO NOT EDIT.
2
- // protoc-gen-go-vtproto version: v0.4.0
2
+ // protoc-gen-go-vtproto version: v0.6.0
3
3
  // source: github.com/aperturerobotics/starpc/srpc/rpcproto.proto
4
4
 
5
5
  package srpc
@@ -7,8 +7,8 @@ package srpc
7
7
  import (
8
8
  fmt "fmt"
9
9
  io "io"
10
- bits "math/bits"
11
10
 
11
+ protohelpers "github.com/planetscale/vtprotobuf/protohelpers"
12
12
  proto "google.golang.org/protobuf/proto"
13
13
  protoimpl "google.golang.org/protobuf/runtime/protoimpl"
14
14
  )
@@ -24,7 +24,7 @@ func (m *Packet) CloneVT() *Packet {
24
24
  if m == nil {
25
25
  return (*Packet)(nil)
26
26
  }
27
- r := &Packet{}
27
+ r := new(Packet)
28
28
  if m.Body != nil {
29
29
  r.Body = m.Body.(interface{ CloneVT() isPacket_Body }).CloneVT()
30
30
  }
@@ -43,9 +43,8 @@ func (m *Packet_CallStart) CloneVT() isPacket_Body {
43
43
  if m == nil {
44
44
  return (*Packet_CallStart)(nil)
45
45
  }
46
- r := &Packet_CallStart{
47
- CallStart: m.CallStart.CloneVT(),
48
- }
46
+ r := new(Packet_CallStart)
47
+ r.CallStart = m.CallStart.CloneVT()
49
48
  return r
50
49
  }
51
50
 
@@ -53,9 +52,8 @@ func (m *Packet_CallData) CloneVT() isPacket_Body {
53
52
  if m == nil {
54
53
  return (*Packet_CallData)(nil)
55
54
  }
56
- r := &Packet_CallData{
57
- CallData: m.CallData.CloneVT(),
58
- }
55
+ r := new(Packet_CallData)
56
+ r.CallData = m.CallData.CloneVT()
59
57
  return r
60
58
  }
61
59
 
@@ -63,9 +61,8 @@ func (m *Packet_CallCancel) CloneVT() isPacket_Body {
63
61
  if m == nil {
64
62
  return (*Packet_CallCancel)(nil)
65
63
  }
66
- r := &Packet_CallCancel{
67
- CallCancel: m.CallCancel,
68
- }
64
+ r := new(Packet_CallCancel)
65
+ r.CallCancel = m.CallCancel
69
66
  return r
70
67
  }
71
68
 
@@ -73,11 +70,10 @@ func (m *CallStart) CloneVT() *CallStart {
73
70
  if m == nil {
74
71
  return (*CallStart)(nil)
75
72
  }
76
- r := &CallStart{
77
- RpcService: m.RpcService,
78
- RpcMethod: m.RpcMethod,
79
- DataIsZero: m.DataIsZero,
80
- }
73
+ r := new(CallStart)
74
+ r.RpcService = m.RpcService
75
+ r.RpcMethod = m.RpcMethod
76
+ r.DataIsZero = m.DataIsZero
81
77
  if rhs := m.Data; rhs != nil {
82
78
  tmpBytes := make([]byte, len(rhs))
83
79
  copy(tmpBytes, rhs)
@@ -98,11 +94,10 @@ func (m *CallData) CloneVT() *CallData {
98
94
  if m == nil {
99
95
  return (*CallData)(nil)
100
96
  }
101
- r := &CallData{
102
- DataIsZero: m.DataIsZero,
103
- Complete: m.Complete,
104
- Error: m.Error,
105
- }
97
+ r := new(CallData)
98
+ r.DataIsZero = m.DataIsZero
99
+ r.Complete = m.Complete
100
+ r.Error = m.Error
106
101
  if rhs := m.Data; rhs != nil {
107
102
  tmpBytes := make([]byte, len(rhs))
108
103
  copy(tmpBytes, rhs)
@@ -323,7 +318,7 @@ func (m *Packet_CallStart) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
323
318
  return 0, err
324
319
  }
325
320
  i -= size
326
- i = encodeVarint(dAtA, i, uint64(size))
321
+ i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
327
322
  i--
328
323
  dAtA[i] = 0xa
329
324
  }
@@ -342,7 +337,7 @@ func (m *Packet_CallData) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
342
337
  return 0, err
343
338
  }
344
339
  i -= size
345
- i = encodeVarint(dAtA, i, uint64(size))
340
+ i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
346
341
  i--
347
342
  dAtA[i] = 0x12
348
343
  }
@@ -408,21 +403,21 @@ func (m *CallStart) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
408
403
  if len(m.Data) > 0 {
409
404
  i -= len(m.Data)
410
405
  copy(dAtA[i:], m.Data)
411
- i = encodeVarint(dAtA, i, uint64(len(m.Data)))
406
+ i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Data)))
412
407
  i--
413
408
  dAtA[i] = 0x1a
414
409
  }
415
410
  if len(m.RpcMethod) > 0 {
416
411
  i -= len(m.RpcMethod)
417
412
  copy(dAtA[i:], m.RpcMethod)
418
- i = encodeVarint(dAtA, i, uint64(len(m.RpcMethod)))
413
+ i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RpcMethod)))
419
414
  i--
420
415
  dAtA[i] = 0x12
421
416
  }
422
417
  if len(m.RpcService) > 0 {
423
418
  i -= len(m.RpcService)
424
419
  copy(dAtA[i:], m.RpcService)
425
- i = encodeVarint(dAtA, i, uint64(len(m.RpcService)))
420
+ i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RpcService)))
426
421
  i--
427
422
  dAtA[i] = 0xa
428
423
  }
@@ -462,7 +457,7 @@ func (m *CallData) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
462
457
  if len(m.Error) > 0 {
463
458
  i -= len(m.Error)
464
459
  copy(dAtA[i:], m.Error)
465
- i = encodeVarint(dAtA, i, uint64(len(m.Error)))
460
+ i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Error)))
466
461
  i--
467
462
  dAtA[i] = 0x22
468
463
  }
@@ -489,24 +484,13 @@ func (m *CallData) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
489
484
  if len(m.Data) > 0 {
490
485
  i -= len(m.Data)
491
486
  copy(dAtA[i:], m.Data)
492
- i = encodeVarint(dAtA, i, uint64(len(m.Data)))
487
+ i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Data)))
493
488
  i--
494
489
  dAtA[i] = 0xa
495
490
  }
496
491
  return len(dAtA) - i, nil
497
492
  }
498
493
 
499
- func encodeVarint(dAtA []byte, offset int, v uint64) int {
500
- offset -= sov(v)
501
- base := offset
502
- for v >= 1<<7 {
503
- dAtA[offset] = uint8(v&0x7f | 0x80)
504
- v >>= 7
505
- offset++
506
- }
507
- dAtA[offset] = uint8(v)
508
- return base
509
- }
510
494
  func (m *Packet) SizeVT() (n int) {
511
495
  if m == nil {
512
496
  return 0
@@ -528,7 +512,7 @@ func (m *Packet_CallStart) SizeVT() (n int) {
528
512
  _ = l
529
513
  if m.CallStart != nil {
530
514
  l = m.CallStart.SizeVT()
531
- n += 1 + l + sov(uint64(l))
515
+ n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
532
516
  }
533
517
  return n
534
518
  }
@@ -540,7 +524,7 @@ func (m *Packet_CallData) SizeVT() (n int) {
540
524
  _ = l
541
525
  if m.CallData != nil {
542
526
  l = m.CallData.SizeVT()
543
- n += 1 + l + sov(uint64(l))
527
+ n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
544
528
  }
545
529
  return n
546
530
  }
@@ -561,15 +545,15 @@ func (m *CallStart) SizeVT() (n int) {
561
545
  _ = l
562
546
  l = len(m.RpcService)
563
547
  if l > 0 {
564
- n += 1 + l + sov(uint64(l))
548
+ n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
565
549
  }
566
550
  l = len(m.RpcMethod)
567
551
  if l > 0 {
568
- n += 1 + l + sov(uint64(l))
552
+ n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
569
553
  }
570
554
  l = len(m.Data)
571
555
  if l > 0 {
572
- n += 1 + l + sov(uint64(l))
556
+ n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
573
557
  }
574
558
  if m.DataIsZero {
575
559
  n += 2
@@ -586,7 +570,7 @@ func (m *CallData) SizeVT() (n int) {
586
570
  _ = l
587
571
  l = len(m.Data)
588
572
  if l > 0 {
589
- n += 1 + l + sov(uint64(l))
573
+ n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
590
574
  }
591
575
  if m.DataIsZero {
592
576
  n += 2
@@ -596,18 +580,12 @@ func (m *CallData) SizeVT() (n int) {
596
580
  }
597
581
  l = len(m.Error)
598
582
  if l > 0 {
599
- n += 1 + l + sov(uint64(l))
583
+ n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
600
584
  }
601
585
  n += len(m.unknownFields)
602
586
  return n
603
587
  }
604
588
 
605
- func sov(x uint64) (n int) {
606
- return (bits.Len64(x|1) + 6) / 7
607
- }
608
- func soz(x uint64) (n int) {
609
- return sov(uint64((x << 1) ^ uint64((int64(x) >> 63))))
610
- }
611
589
  func (m *Packet) UnmarshalVT(dAtA []byte) error {
612
590
  l := len(dAtA)
613
591
  iNdEx := 0
@@ -616,7 +594,7 @@ func (m *Packet) UnmarshalVT(dAtA []byte) error {
616
594
  var wire uint64
617
595
  for shift := uint(0); ; shift += 7 {
618
596
  if shift >= 64 {
619
- return ErrIntOverflow
597
+ return protohelpers.ErrIntOverflow
620
598
  }
621
599
  if iNdEx >= l {
622
600
  return io.ErrUnexpectedEOF
@@ -644,7 +622,7 @@ func (m *Packet) UnmarshalVT(dAtA []byte) error {
644
622
  var msglen int
645
623
  for shift := uint(0); ; shift += 7 {
646
624
  if shift >= 64 {
647
- return ErrIntOverflow
625
+ return protohelpers.ErrIntOverflow
648
626
  }
649
627
  if iNdEx >= l {
650
628
  return io.ErrUnexpectedEOF
@@ -657,11 +635,11 @@ func (m *Packet) UnmarshalVT(dAtA []byte) error {
657
635
  }
658
636
  }
659
637
  if msglen < 0 {
660
- return ErrInvalidLength
638
+ return protohelpers.ErrInvalidLength
661
639
  }
662
640
  postIndex := iNdEx + msglen
663
641
  if postIndex < 0 {
664
- return ErrInvalidLength
642
+ return protohelpers.ErrInvalidLength
665
643
  }
666
644
  if postIndex > l {
667
645
  return io.ErrUnexpectedEOF
@@ -685,7 +663,7 @@ func (m *Packet) UnmarshalVT(dAtA []byte) error {
685
663
  var msglen int
686
664
  for shift := uint(0); ; shift += 7 {
687
665
  if shift >= 64 {
688
- return ErrIntOverflow
666
+ return protohelpers.ErrIntOverflow
689
667
  }
690
668
  if iNdEx >= l {
691
669
  return io.ErrUnexpectedEOF
@@ -698,11 +676,11 @@ func (m *Packet) UnmarshalVT(dAtA []byte) error {
698
676
  }
699
677
  }
700
678
  if msglen < 0 {
701
- return ErrInvalidLength
679
+ return protohelpers.ErrInvalidLength
702
680
  }
703
681
  postIndex := iNdEx + msglen
704
682
  if postIndex < 0 {
705
- return ErrInvalidLength
683
+ return protohelpers.ErrInvalidLength
706
684
  }
707
685
  if postIndex > l {
708
686
  return io.ErrUnexpectedEOF
@@ -726,7 +704,7 @@ func (m *Packet) UnmarshalVT(dAtA []byte) error {
726
704
  var v int
727
705
  for shift := uint(0); ; shift += 7 {
728
706
  if shift >= 64 {
729
- return ErrIntOverflow
707
+ return protohelpers.ErrIntOverflow
730
708
  }
731
709
  if iNdEx >= l {
732
710
  return io.ErrUnexpectedEOF
@@ -742,12 +720,12 @@ func (m *Packet) UnmarshalVT(dAtA []byte) error {
742
720
  m.Body = &Packet_CallCancel{CallCancel: b}
743
721
  default:
744
722
  iNdEx = preIndex
745
- skippy, err := skip(dAtA[iNdEx:])
723
+ skippy, err := protohelpers.Skip(dAtA[iNdEx:])
746
724
  if err != nil {
747
725
  return err
748
726
  }
749
727
  if (skippy < 0) || (iNdEx+skippy) < 0 {
750
- return ErrInvalidLength
728
+ return protohelpers.ErrInvalidLength
751
729
  }
752
730
  if (iNdEx + skippy) > l {
753
731
  return io.ErrUnexpectedEOF
@@ -770,7 +748,7 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
770
748
  var wire uint64
771
749
  for shift := uint(0); ; shift += 7 {
772
750
  if shift >= 64 {
773
- return ErrIntOverflow
751
+ return protohelpers.ErrIntOverflow
774
752
  }
775
753
  if iNdEx >= l {
776
754
  return io.ErrUnexpectedEOF
@@ -798,7 +776,7 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
798
776
  var stringLen uint64
799
777
  for shift := uint(0); ; shift += 7 {
800
778
  if shift >= 64 {
801
- return ErrIntOverflow
779
+ return protohelpers.ErrIntOverflow
802
780
  }
803
781
  if iNdEx >= l {
804
782
  return io.ErrUnexpectedEOF
@@ -812,11 +790,11 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
812
790
  }
813
791
  intStringLen := int(stringLen)
814
792
  if intStringLen < 0 {
815
- return ErrInvalidLength
793
+ return protohelpers.ErrInvalidLength
816
794
  }
817
795
  postIndex := iNdEx + intStringLen
818
796
  if postIndex < 0 {
819
- return ErrInvalidLength
797
+ return protohelpers.ErrInvalidLength
820
798
  }
821
799
  if postIndex > l {
822
800
  return io.ErrUnexpectedEOF
@@ -830,7 +808,7 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
830
808
  var stringLen uint64
831
809
  for shift := uint(0); ; shift += 7 {
832
810
  if shift >= 64 {
833
- return ErrIntOverflow
811
+ return protohelpers.ErrIntOverflow
834
812
  }
835
813
  if iNdEx >= l {
836
814
  return io.ErrUnexpectedEOF
@@ -844,11 +822,11 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
844
822
  }
845
823
  intStringLen := int(stringLen)
846
824
  if intStringLen < 0 {
847
- return ErrInvalidLength
825
+ return protohelpers.ErrInvalidLength
848
826
  }
849
827
  postIndex := iNdEx + intStringLen
850
828
  if postIndex < 0 {
851
- return ErrInvalidLength
829
+ return protohelpers.ErrInvalidLength
852
830
  }
853
831
  if postIndex > l {
854
832
  return io.ErrUnexpectedEOF
@@ -862,7 +840,7 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
862
840
  var byteLen int
863
841
  for shift := uint(0); ; shift += 7 {
864
842
  if shift >= 64 {
865
- return ErrIntOverflow
843
+ return protohelpers.ErrIntOverflow
866
844
  }
867
845
  if iNdEx >= l {
868
846
  return io.ErrUnexpectedEOF
@@ -875,11 +853,11 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
875
853
  }
876
854
  }
877
855
  if byteLen < 0 {
878
- return ErrInvalidLength
856
+ return protohelpers.ErrInvalidLength
879
857
  }
880
858
  postIndex := iNdEx + byteLen
881
859
  if postIndex < 0 {
882
- return ErrInvalidLength
860
+ return protohelpers.ErrInvalidLength
883
861
  }
884
862
  if postIndex > l {
885
863
  return io.ErrUnexpectedEOF
@@ -896,7 +874,7 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
896
874
  var v int
897
875
  for shift := uint(0); ; shift += 7 {
898
876
  if shift >= 64 {
899
- return ErrIntOverflow
877
+ return protohelpers.ErrIntOverflow
900
878
  }
901
879
  if iNdEx >= l {
902
880
  return io.ErrUnexpectedEOF
@@ -911,12 +889,12 @@ func (m *CallStart) UnmarshalVT(dAtA []byte) error {
911
889
  m.DataIsZero = bool(v != 0)
912
890
  default:
913
891
  iNdEx = preIndex
914
- skippy, err := skip(dAtA[iNdEx:])
892
+ skippy, err := protohelpers.Skip(dAtA[iNdEx:])
915
893
  if err != nil {
916
894
  return err
917
895
  }
918
896
  if (skippy < 0) || (iNdEx+skippy) < 0 {
919
- return ErrInvalidLength
897
+ return protohelpers.ErrInvalidLength
920
898
  }
921
899
  if (iNdEx + skippy) > l {
922
900
  return io.ErrUnexpectedEOF
@@ -939,7 +917,7 @@ func (m *CallData) UnmarshalVT(dAtA []byte) error {
939
917
  var wire uint64
940
918
  for shift := uint(0); ; shift += 7 {
941
919
  if shift >= 64 {
942
- return ErrIntOverflow
920
+ return protohelpers.ErrIntOverflow
943
921
  }
944
922
  if iNdEx >= l {
945
923
  return io.ErrUnexpectedEOF
@@ -967,7 +945,7 @@ func (m *CallData) UnmarshalVT(dAtA []byte) error {
967
945
  var byteLen int
968
946
  for shift := uint(0); ; shift += 7 {
969
947
  if shift >= 64 {
970
- return ErrIntOverflow
948
+ return protohelpers.ErrIntOverflow
971
949
  }
972
950
  if iNdEx >= l {
973
951
  return io.ErrUnexpectedEOF
@@ -980,11 +958,11 @@ func (m *CallData) UnmarshalVT(dAtA []byte) error {
980
958
  }
981
959
  }
982
960
  if byteLen < 0 {
983
- return ErrInvalidLength
961
+ return protohelpers.ErrInvalidLength
984
962
  }
985
963
  postIndex := iNdEx + byteLen
986
964
  if postIndex < 0 {
987
- return ErrInvalidLength
965
+ return protohelpers.ErrInvalidLength
988
966
  }
989
967
  if postIndex > l {
990
968
  return io.ErrUnexpectedEOF
@@ -1001,7 +979,7 @@ func (m *CallData) UnmarshalVT(dAtA []byte) error {
1001
979
  var v int
1002
980
  for shift := uint(0); ; shift += 7 {
1003
981
  if shift >= 64 {
1004
- return ErrIntOverflow
982
+ return protohelpers.ErrIntOverflow
1005
983
  }
1006
984
  if iNdEx >= l {
1007
985
  return io.ErrUnexpectedEOF
@@ -1021,7 +999,7 @@ func (m *CallData) UnmarshalVT(dAtA []byte) error {
1021
999
  var v int
1022
1000
  for shift := uint(0); ; shift += 7 {
1023
1001
  if shift >= 64 {
1024
- return ErrIntOverflow
1002
+ return protohelpers.ErrIntOverflow
1025
1003
  }
1026
1004
  if iNdEx >= l {
1027
1005
  return io.ErrUnexpectedEOF
@@ -1041,7 +1019,7 @@ func (m *CallData) UnmarshalVT(dAtA []byte) error {
1041
1019
  var stringLen uint64
1042
1020
  for shift := uint(0); ; shift += 7 {
1043
1021
  if shift >= 64 {
1044
- return ErrIntOverflow
1022
+ return protohelpers.ErrIntOverflow
1045
1023
  }
1046
1024
  if iNdEx >= l {
1047
1025
  return io.ErrUnexpectedEOF
@@ -1055,11 +1033,11 @@ func (m *CallData) UnmarshalVT(dAtA []byte) error {
1055
1033
  }
1056
1034
  intStringLen := int(stringLen)
1057
1035
  if intStringLen < 0 {
1058
- return ErrInvalidLength
1036
+ return protohelpers.ErrInvalidLength
1059
1037
  }
1060
1038
  postIndex := iNdEx + intStringLen
1061
1039
  if postIndex < 0 {
1062
- return ErrInvalidLength
1040
+ return protohelpers.ErrInvalidLength
1063
1041
  }
1064
1042
  if postIndex > l {
1065
1043
  return io.ErrUnexpectedEOF
@@ -1068,12 +1046,12 @@ func (m *CallData) UnmarshalVT(dAtA []byte) error {
1068
1046
  iNdEx = postIndex
1069
1047
  default:
1070
1048
  iNdEx = preIndex
1071
- skippy, err := skip(dAtA[iNdEx:])
1049
+ skippy, err := protohelpers.Skip(dAtA[iNdEx:])
1072
1050
  if err != nil {
1073
1051
  return err
1074
1052
  }
1075
1053
  if (skippy < 0) || (iNdEx+skippy) < 0 {
1076
- return ErrInvalidLength
1054
+ return protohelpers.ErrInvalidLength
1077
1055
  }
1078
1056
  if (iNdEx + skippy) > l {
1079
1057
  return io.ErrUnexpectedEOF
@@ -1088,88 +1066,3 @@ func (m *CallData) UnmarshalVT(dAtA []byte) error {
1088
1066
  }
1089
1067
  return nil
1090
1068
  }
1091
-
1092
- func skip(dAtA []byte) (n int, err error) {
1093
- l := len(dAtA)
1094
- iNdEx := 0
1095
- depth := 0
1096
- for iNdEx < l {
1097
- var wire uint64
1098
- for shift := uint(0); ; shift += 7 {
1099
- if shift >= 64 {
1100
- return 0, ErrIntOverflow
1101
- }
1102
- if iNdEx >= l {
1103
- return 0, io.ErrUnexpectedEOF
1104
- }
1105
- b := dAtA[iNdEx]
1106
- iNdEx++
1107
- wire |= (uint64(b) & 0x7F) << shift
1108
- if b < 0x80 {
1109
- break
1110
- }
1111
- }
1112
- wireType := int(wire & 0x7)
1113
- switch wireType {
1114
- case 0:
1115
- for shift := uint(0); ; shift += 7 {
1116
- if shift >= 64 {
1117
- return 0, ErrIntOverflow
1118
- }
1119
- if iNdEx >= l {
1120
- return 0, io.ErrUnexpectedEOF
1121
- }
1122
- iNdEx++
1123
- if dAtA[iNdEx-1] < 0x80 {
1124
- break
1125
- }
1126
- }
1127
- case 1:
1128
- iNdEx += 8
1129
- case 2:
1130
- var length int
1131
- for shift := uint(0); ; shift += 7 {
1132
- if shift >= 64 {
1133
- return 0, ErrIntOverflow
1134
- }
1135
- if iNdEx >= l {
1136
- return 0, io.ErrUnexpectedEOF
1137
- }
1138
- b := dAtA[iNdEx]
1139
- iNdEx++
1140
- length |= (int(b) & 0x7F) << shift
1141
- if b < 0x80 {
1142
- break
1143
- }
1144
- }
1145
- if length < 0 {
1146
- return 0, ErrInvalidLength
1147
- }
1148
- iNdEx += length
1149
- case 3:
1150
- depth++
1151
- case 4:
1152
- if depth == 0 {
1153
- return 0, ErrUnexpectedEndOfGroup
1154
- }
1155
- depth--
1156
- case 5:
1157
- iNdEx += 4
1158
- default:
1159
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
1160
- }
1161
- if iNdEx < 0 {
1162
- return 0, ErrInvalidLength
1163
- }
1164
- if depth == 0 {
1165
- return iNdEx, nil
1166
- }
1167
- }
1168
- return 0, io.ErrUnexpectedEOF
1169
- }
1170
-
1171
- var (
1172
- ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling")
1173
- ErrIntOverflow = fmt.Errorf("proto: integer overflow")
1174
- ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
1175
- )