starpc 0.31.2 → 0.31.4
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 +1 -1
- package/e2e/mock/mock.pb.go +17 -2
- package/echo/echo.pb.go +17 -2
- package/go.mod +2 -2
- package/go.sum +4 -4
- package/package.json +5 -7
- package/srpc/rpcproto.pb.go +87 -4
package/Makefile
CHANGED
|
@@ -87,7 +87,7 @@ genproto: vendor node_modules $(GOIMPORTS) $(PROTOWRAP) $(PROTOC_GEN_GO) $(PROTO
|
|
|
87
87
|
--plugin=./node_modules/.bin/protoc-gen-es \
|
|
88
88
|
--plugin=./cmd/protoc-gen-es-starpc/dev/protoc-gen-es-starpc \
|
|
89
89
|
--go-lite_out=$${OUT} \
|
|
90
|
-
--go-lite_opt=features=marshal+unmarshal+size+equal+json+clone \
|
|
90
|
+
--go-lite_opt=features=marshal+unmarshal+size+equal+json+clone+text \
|
|
91
91
|
--go-starpc_out=$${OUT} \
|
|
92
92
|
--es_out=$${OUT} \
|
|
93
93
|
--es_opt target=ts \
|
package/e2e/mock/mock.pb.go
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
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.5.0
|
|
3
3
|
// source: github.com/aperturerobotics/starpc/e2e/mock/mock.proto
|
|
4
4
|
|
|
5
5
|
package e2e_mock
|
|
6
6
|
|
|
7
7
|
import (
|
|
8
8
|
io "io"
|
|
9
|
+
strconv "strconv"
|
|
10
|
+
strings "strings"
|
|
9
11
|
|
|
10
12
|
protobuf_go_lite "github.com/aperturerobotics/protobuf-go-lite"
|
|
11
13
|
json "github.com/aperturerobotics/protobuf-go-lite/json"
|
|
@@ -44,7 +46,7 @@ func (m *MockMsg) CloneVT() *MockMsg {
|
|
|
44
46
|
return r
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
func (m *MockMsg) CloneMessageVT()
|
|
49
|
+
func (m *MockMsg) CloneMessageVT() protobuf_go_lite.CloneMessage {
|
|
48
50
|
return m.CloneVT()
|
|
49
51
|
}
|
|
50
52
|
|
|
@@ -164,6 +166,19 @@ func (m *MockMsg) SizeVT() (n int) {
|
|
|
164
166
|
return n
|
|
165
167
|
}
|
|
166
168
|
|
|
169
|
+
func (x *MockMsg) MarshalProtoText() string {
|
|
170
|
+
var sb strings.Builder
|
|
171
|
+
sb.WriteString("MockMsg { ")
|
|
172
|
+
if x.Body != "" {
|
|
173
|
+
sb.WriteString(" body: ")
|
|
174
|
+
sb.WriteString(strconv.Quote(x.Body))
|
|
175
|
+
}
|
|
176
|
+
sb.WriteString("}")
|
|
177
|
+
return sb.String()
|
|
178
|
+
}
|
|
179
|
+
func (x *MockMsg) String() string {
|
|
180
|
+
return x.MarshalProtoText()
|
|
181
|
+
}
|
|
167
182
|
func (m *MockMsg) UnmarshalVT(dAtA []byte) error {
|
|
168
183
|
l := len(dAtA)
|
|
169
184
|
iNdEx := 0
|
package/echo/echo.pb.go
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
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.5.0
|
|
3
3
|
// source: github.com/aperturerobotics/starpc/echo/echo.proto
|
|
4
4
|
|
|
5
5
|
package echo
|
|
6
6
|
|
|
7
7
|
import (
|
|
8
8
|
io "io"
|
|
9
|
+
strconv "strconv"
|
|
10
|
+
strings "strings"
|
|
9
11
|
|
|
10
12
|
protobuf_go_lite "github.com/aperturerobotics/protobuf-go-lite"
|
|
11
13
|
json "github.com/aperturerobotics/protobuf-go-lite/json"
|
|
@@ -45,7 +47,7 @@ func (m *EchoMsg) CloneVT() *EchoMsg {
|
|
|
45
47
|
return r
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
func (m *EchoMsg) CloneMessageVT()
|
|
50
|
+
func (m *EchoMsg) CloneMessageVT() protobuf_go_lite.CloneMessage {
|
|
49
51
|
return m.CloneVT()
|
|
50
52
|
}
|
|
51
53
|
|
|
@@ -165,6 +167,19 @@ func (m *EchoMsg) SizeVT() (n int) {
|
|
|
165
167
|
return n
|
|
166
168
|
}
|
|
167
169
|
|
|
170
|
+
func (x *EchoMsg) MarshalProtoText() string {
|
|
171
|
+
var sb strings.Builder
|
|
172
|
+
sb.WriteString("EchoMsg { ")
|
|
173
|
+
if x.Body != "" {
|
|
174
|
+
sb.WriteString(" body: ")
|
|
175
|
+
sb.WriteString(strconv.Quote(x.Body))
|
|
176
|
+
}
|
|
177
|
+
sb.WriteString("}")
|
|
178
|
+
return sb.String()
|
|
179
|
+
}
|
|
180
|
+
func (x *EchoMsg) String() string {
|
|
181
|
+
return x.MarshalProtoText()
|
|
182
|
+
}
|
|
168
183
|
func (m *EchoMsg) UnmarshalVT(dAtA []byte) error {
|
|
169
184
|
l := len(dAtA)
|
|
170
185
|
iNdEx := 0
|
package/go.mod
CHANGED
|
@@ -3,8 +3,8 @@ module github.com/aperturerobotics/starpc
|
|
|
3
3
|
go 1.22
|
|
4
4
|
|
|
5
5
|
require (
|
|
6
|
-
github.com/aperturerobotics/protobuf-go-lite v0.
|
|
7
|
-
github.com/aperturerobotics/util v1.
|
|
6
|
+
github.com/aperturerobotics/protobuf-go-lite v0.5.0 // latest
|
|
7
|
+
github.com/aperturerobotics/util v1.18.1 // latest
|
|
8
8
|
)
|
|
9
9
|
|
|
10
10
|
require (
|
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.5.0 h1:JmTfiOeTQv06EYIFyVkjkmGXxI7JoCRuokVK2SOvo3I=
|
|
2
|
+
github.com/aperturerobotics/protobuf-go-lite v0.5.0/go.mod h1:/EduuzDxtr5s0e9s10XYG35+pPgvrgg3UmBliivOaSs=
|
|
3
|
+
github.com/aperturerobotics/util v1.18.1 h1:Iu8toMYRKs3d0TH8JkAMwfEYY8bEekDaTEvLOVVqh44=
|
|
4
|
+
github.com/aperturerobotics/util v1.18.1/go.mod h1:Oz7Rmq5sKS1UgTRJkDWYfyf1LiA2rIRbnO341Xd91bU=
|
|
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=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "starpc",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.4",
|
|
4
4
|
"description": "Streaming protobuf RPC service protocol over any two-way channel.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"gen": "make genproto",
|
|
52
52
|
"test": "npm run test:js && npm run test:go",
|
|
53
53
|
"test:go": "make test",
|
|
54
|
-
"build:e2e": "npm run build && cd e2e && esbuild e2e.ts --sourcemap --outfile=e2e.
|
|
55
|
-
"test:js": "npm run build:e2e && cd e2e && node ./e2e.
|
|
56
|
-
"debug:js": "npm run build:e2e && cd e2e && node --inspect --inspect-brk ./e2e.
|
|
54
|
+
"build:e2e": "npm run build && cd e2e && esbuild e2e.ts --sourcemap --outfile=e2e.cjs --bundle --platform=node",
|
|
55
|
+
"test:js": "npm run build:e2e && cd e2e && node ./e2e.cjs",
|
|
56
|
+
"debug:js": "npm run build:e2e && cd e2e && node --inspect --inspect-brk ./e2e.cjs",
|
|
57
57
|
"test:integration": "make integration",
|
|
58
58
|
"integration": "npm run test:integration",
|
|
59
59
|
"lint": "npm run lint:go && npm run lint:js",
|
|
@@ -70,7 +70,6 @@
|
|
|
70
70
|
"@bufbuild/protoc-gen-es": "^1.8.0",
|
|
71
71
|
"@typescript-eslint/eslint-plugin": "^7.7.0",
|
|
72
72
|
"@typescript-eslint/parser": "^7.7.0",
|
|
73
|
-
"bufferutil": "^4.0.7",
|
|
74
73
|
"depcheck": "^1.4.6",
|
|
75
74
|
"esbuild": "^0.20.0",
|
|
76
75
|
"eslint": "^9.1.0",
|
|
@@ -78,8 +77,7 @@
|
|
|
78
77
|
"prettier": "^3.2.4",
|
|
79
78
|
"rimraf": "^5.0.1",
|
|
80
79
|
"tsx": "^4.7.2",
|
|
81
|
-
"typescript": "^5.3.2"
|
|
82
|
-
"utf-8-validate": "^6.0.3"
|
|
80
|
+
"typescript": "^5.3.2"
|
|
83
81
|
},
|
|
84
82
|
"dependencies": {
|
|
85
83
|
"@aptre/it-ws": "^1.0.0",
|
package/srpc/rpcproto.pb.go
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
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.5.0
|
|
3
3
|
// source: github.com/aperturerobotics/starpc/srpc/rpcproto.proto
|
|
4
4
|
|
|
5
5
|
package srpc
|
|
6
6
|
|
|
7
7
|
import (
|
|
8
|
+
base64 "encoding/base64"
|
|
8
9
|
io "io"
|
|
10
|
+
strconv "strconv"
|
|
11
|
+
strings "strings"
|
|
9
12
|
|
|
10
13
|
protobuf_go_lite "github.com/aperturerobotics/protobuf-go-lite"
|
|
11
14
|
json "github.com/aperturerobotics/protobuf-go-lite/json"
|
|
@@ -197,7 +200,7 @@ func (m *Packet) CloneVT() *Packet {
|
|
|
197
200
|
return r
|
|
198
201
|
}
|
|
199
202
|
|
|
200
|
-
func (m *Packet) CloneMessageVT()
|
|
203
|
+
func (m *Packet) CloneMessageVT() protobuf_go_lite.CloneMessage {
|
|
201
204
|
return m.CloneVT()
|
|
202
205
|
}
|
|
203
206
|
|
|
@@ -248,7 +251,7 @@ func (m *CallStart) CloneVT() *CallStart {
|
|
|
248
251
|
return r
|
|
249
252
|
}
|
|
250
253
|
|
|
251
|
-
func (m *CallStart) CloneMessageVT()
|
|
254
|
+
func (m *CallStart) CloneMessageVT() protobuf_go_lite.CloneMessage {
|
|
252
255
|
return m.CloneVT()
|
|
253
256
|
}
|
|
254
257
|
|
|
@@ -272,7 +275,7 @@ func (m *CallData) CloneVT() *CallData {
|
|
|
272
275
|
return r
|
|
273
276
|
}
|
|
274
277
|
|
|
275
|
-
func (m *CallData) CloneMessageVT()
|
|
278
|
+
func (m *CallData) CloneMessageVT() protobuf_go_lite.CloneMessage {
|
|
276
279
|
return m.CloneVT()
|
|
277
280
|
}
|
|
278
281
|
|
|
@@ -966,6 +969,86 @@ func (m *CallData) SizeVT() (n int) {
|
|
|
966
969
|
return n
|
|
967
970
|
}
|
|
968
971
|
|
|
972
|
+
func (x *Packet) MarshalProtoText() string {
|
|
973
|
+
var sb strings.Builder
|
|
974
|
+
sb.WriteString("Packet { ")
|
|
975
|
+
switch body := x.Body.(type) {
|
|
976
|
+
case *Packet_CallStart:
|
|
977
|
+
if body.CallStart != nil {
|
|
978
|
+
sb.WriteString(" call_start: ")
|
|
979
|
+
sb.WriteString(body.CallStart.MarshalProtoText())
|
|
980
|
+
}
|
|
981
|
+
case *Packet_CallData:
|
|
982
|
+
if body.CallData != nil {
|
|
983
|
+
sb.WriteString(" call_data: ")
|
|
984
|
+
sb.WriteString(body.CallData.MarshalProtoText())
|
|
985
|
+
}
|
|
986
|
+
case *Packet_CallCancel:
|
|
987
|
+
if body.CallCancel {
|
|
988
|
+
sb.WriteString(" call_cancel: ")
|
|
989
|
+
sb.WriteString(strconv.FormatBool(body.CallCancel))
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
sb.WriteString("}")
|
|
993
|
+
return sb.String()
|
|
994
|
+
}
|
|
995
|
+
func (x *Packet) String() string {
|
|
996
|
+
return x.MarshalProtoText()
|
|
997
|
+
}
|
|
998
|
+
func (x *CallStart) MarshalProtoText() string {
|
|
999
|
+
var sb strings.Builder
|
|
1000
|
+
sb.WriteString("CallStart { ")
|
|
1001
|
+
if x.RpcService != "" {
|
|
1002
|
+
sb.WriteString(" rpc_service: ")
|
|
1003
|
+
sb.WriteString(strconv.Quote(x.RpcService))
|
|
1004
|
+
}
|
|
1005
|
+
if x.RpcMethod != "" {
|
|
1006
|
+
sb.WriteString(" rpc_method: ")
|
|
1007
|
+
sb.WriteString(strconv.Quote(x.RpcMethod))
|
|
1008
|
+
}
|
|
1009
|
+
if len(x.Data) > 0 {
|
|
1010
|
+
sb.WriteString(" data: ")
|
|
1011
|
+
sb.WriteString("\"")
|
|
1012
|
+
sb.WriteString(base64.StdEncoding.EncodeToString(x.Data))
|
|
1013
|
+
sb.WriteString("\"")
|
|
1014
|
+
}
|
|
1015
|
+
if x.DataIsZero {
|
|
1016
|
+
sb.WriteString(" data_is_zero: ")
|
|
1017
|
+
sb.WriteString(strconv.FormatBool(x.DataIsZero))
|
|
1018
|
+
}
|
|
1019
|
+
sb.WriteString("}")
|
|
1020
|
+
return sb.String()
|
|
1021
|
+
}
|
|
1022
|
+
func (x *CallStart) String() string {
|
|
1023
|
+
return x.MarshalProtoText()
|
|
1024
|
+
}
|
|
1025
|
+
func (x *CallData) MarshalProtoText() string {
|
|
1026
|
+
var sb strings.Builder
|
|
1027
|
+
sb.WriteString("CallData { ")
|
|
1028
|
+
if len(x.Data) > 0 {
|
|
1029
|
+
sb.WriteString(" data: ")
|
|
1030
|
+
sb.WriteString("\"")
|
|
1031
|
+
sb.WriteString(base64.StdEncoding.EncodeToString(x.Data))
|
|
1032
|
+
sb.WriteString("\"")
|
|
1033
|
+
}
|
|
1034
|
+
if x.DataIsZero {
|
|
1035
|
+
sb.WriteString(" data_is_zero: ")
|
|
1036
|
+
sb.WriteString(strconv.FormatBool(x.DataIsZero))
|
|
1037
|
+
}
|
|
1038
|
+
if x.Complete {
|
|
1039
|
+
sb.WriteString(" complete: ")
|
|
1040
|
+
sb.WriteString(strconv.FormatBool(x.Complete))
|
|
1041
|
+
}
|
|
1042
|
+
if x.Error != "" {
|
|
1043
|
+
sb.WriteString(" error: ")
|
|
1044
|
+
sb.WriteString(strconv.Quote(x.Error))
|
|
1045
|
+
}
|
|
1046
|
+
sb.WriteString("}")
|
|
1047
|
+
return sb.String()
|
|
1048
|
+
}
|
|
1049
|
+
func (x *CallData) String() string {
|
|
1050
|
+
return x.MarshalProtoText()
|
|
1051
|
+
}
|
|
969
1052
|
func (m *Packet) UnmarshalVT(dAtA []byte) error {
|
|
970
1053
|
l := len(dAtA)
|
|
971
1054
|
iNdEx := 0
|