starpc 0.35.2 → 0.35.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/dist/echo/echo.pb.d.ts +1 -1
- package/dist/echo/echo.pb.js +5 -4
- package/dist/echo/echo_srpc.pb.d.ts +4 -4
- package/dist/echo/echo_srpc.pb.js +12 -12
- package/dist/integration/integration.js +1 -1
- package/dist/rpcstream/rpcstream.pb.d.ts +4 -4
- package/dist/rpcstream/rpcstream.pb.js +13 -16
- package/dist/srpc/rpcproto.pb.d.ts +4 -4
- package/dist/srpc/rpcproto.pb.js +19 -34
- package/echo/echo.pb.ts +13 -11
- package/echo/echo_srpc.pb.ts +55 -46
- package/go.mod +7 -8
- package/go.sum +12 -14
- package/integration/integration.go +3 -3
- package/integration/integration.ts +1 -1
- package/package.json +1 -1
- package/srpc/rpcproto.pb.ts +73 -90
package/dist/echo/echo.pb.d.ts
CHANGED
package/dist/echo/echo.pb.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
// @generated by protoc-gen-es-lite unknown with parameter "target=ts,ts_nocheck=false"
|
|
2
2
|
// @generated from file github.com/aperturerobotics/starpc/echo/echo.proto (package echo, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
|
-
import { createMessageType, ScalarType } from
|
|
5
|
-
export const protobufPackage =
|
|
4
|
+
import { createMessageType, ScalarType } from "@aptre/protobuf-es-lite";
|
|
5
|
+
export const protobufPackage = "echo";
|
|
6
|
+
;
|
|
6
7
|
// EchoMsg contains the message type declaration for EchoMsg.
|
|
7
8
|
export const EchoMsg = createMessageType({
|
|
8
|
-
typeName:
|
|
9
|
+
typeName: "echo.EchoMsg",
|
|
9
10
|
fields: [
|
|
10
|
-
{ no: 1, name:
|
|
11
|
+
{ no: 1, name: "body", kind: "scalar", T: ScalarType.STRING },
|
|
11
12
|
],
|
|
12
13
|
packedByDefault: true,
|
|
13
14
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EchoMsg } from
|
|
2
|
-
import { Empty, MethodKind } from
|
|
3
|
-
import { RpcStreamPacket } from
|
|
4
|
-
import { MessageStream, ProtoRpc } from
|
|
1
|
+
import { EchoMsg } from "./echo.pb.js";
|
|
2
|
+
import { Empty, MethodKind } from "@aptre/protobuf-es-lite";
|
|
3
|
+
import { RpcStreamPacket } from "../rpcstream/rpcstream.pb.js";
|
|
4
|
+
import { MessageStream, ProtoRpc } from "starpc";
|
|
5
5
|
/**
|
|
6
6
|
* Echoer service returns the given message.
|
|
7
7
|
*
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// @generated by protoc-gen-es-starpc none with parameter "target=ts,ts_nocheck=false"
|
|
2
2
|
// @generated from file github.com/aperturerobotics/starpc/echo/echo.proto (package echo, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
|
-
import { EchoMsg } from
|
|
5
|
-
import { Empty, MethodKind } from
|
|
6
|
-
import { RpcStreamPacket } from
|
|
7
|
-
import { buildDecodeMessageTransform, buildEncodeMessageTransform
|
|
4
|
+
import { EchoMsg } from "./echo.pb.js";
|
|
5
|
+
import { Empty, MethodKind } from "@aptre/protobuf-es-lite";
|
|
6
|
+
import { RpcStreamPacket } from "../rpcstream/rpcstream.pb.js";
|
|
7
|
+
import { buildDecodeMessageTransform, buildEncodeMessageTransform } from "starpc";
|
|
8
8
|
/**
|
|
9
9
|
* Echoer service returns the given message.
|
|
10
10
|
*
|
|
11
11
|
* @generated from service echo.Echoer
|
|
12
12
|
*/
|
|
13
13
|
export const EchoerDefinition = {
|
|
14
|
-
typeName:
|
|
14
|
+
typeName: "echo.Echoer",
|
|
15
15
|
methods: {
|
|
16
16
|
/**
|
|
17
17
|
* Echo returns the given message.
|
|
@@ -19,7 +19,7 @@ export const EchoerDefinition = {
|
|
|
19
19
|
* @generated from rpc echo.Echoer.Echo
|
|
20
20
|
*/
|
|
21
21
|
Echo: {
|
|
22
|
-
name:
|
|
22
|
+
name: "Echo",
|
|
23
23
|
I: EchoMsg,
|
|
24
24
|
O: EchoMsg,
|
|
25
25
|
kind: MethodKind.Unary,
|
|
@@ -30,7 +30,7 @@ export const EchoerDefinition = {
|
|
|
30
30
|
* @generated from rpc echo.Echoer.EchoServerStream
|
|
31
31
|
*/
|
|
32
32
|
EchoServerStream: {
|
|
33
|
-
name:
|
|
33
|
+
name: "EchoServerStream",
|
|
34
34
|
I: EchoMsg,
|
|
35
35
|
O: EchoMsg,
|
|
36
36
|
kind: MethodKind.ServerStreaming,
|
|
@@ -41,7 +41,7 @@ export const EchoerDefinition = {
|
|
|
41
41
|
* @generated from rpc echo.Echoer.EchoClientStream
|
|
42
42
|
*/
|
|
43
43
|
EchoClientStream: {
|
|
44
|
-
name:
|
|
44
|
+
name: "EchoClientStream",
|
|
45
45
|
I: EchoMsg,
|
|
46
46
|
O: EchoMsg,
|
|
47
47
|
kind: MethodKind.ClientStreaming,
|
|
@@ -52,7 +52,7 @@ export const EchoerDefinition = {
|
|
|
52
52
|
* @generated from rpc echo.Echoer.EchoBidiStream
|
|
53
53
|
*/
|
|
54
54
|
EchoBidiStream: {
|
|
55
|
-
name:
|
|
55
|
+
name: "EchoBidiStream",
|
|
56
56
|
I: EchoMsg,
|
|
57
57
|
O: EchoMsg,
|
|
58
58
|
kind: MethodKind.BiDiStreaming,
|
|
@@ -63,7 +63,7 @@ export const EchoerDefinition = {
|
|
|
63
63
|
* @generated from rpc echo.Echoer.RpcStream
|
|
64
64
|
*/
|
|
65
65
|
RpcStream: {
|
|
66
|
-
name:
|
|
66
|
+
name: "RpcStream",
|
|
67
67
|
I: RpcStreamPacket,
|
|
68
68
|
O: RpcStreamPacket,
|
|
69
69
|
kind: MethodKind.BiDiStreaming,
|
|
@@ -74,12 +74,12 @@ export const EchoerDefinition = {
|
|
|
74
74
|
* @generated from rpc echo.Echoer.DoNothing
|
|
75
75
|
*/
|
|
76
76
|
DoNothing: {
|
|
77
|
-
name:
|
|
77
|
+
name: "DoNothing",
|
|
78
78
|
I: Empty,
|
|
79
79
|
O: Empty,
|
|
80
80
|
kind: MethodKind.Unary,
|
|
81
81
|
},
|
|
82
|
-
}
|
|
82
|
+
}
|
|
83
83
|
};
|
|
84
84
|
export const EchoerServiceName = EchoerDefinition.typeName;
|
|
85
85
|
export class EchoerClient {
|
|
@@ -2,7 +2,7 @@ import { WebSocketConn } from '../srpc/websocket.js';
|
|
|
2
2
|
import { runClientTest, runRpcStreamTest, runAbortControllerTest, } from '../echo/client-test.js';
|
|
3
3
|
import WebSocket from 'isomorphic-ws';
|
|
4
4
|
async function runRPC() {
|
|
5
|
-
const addr = 'ws://localhost:
|
|
5
|
+
const addr = 'ws://localhost:4352/demo';
|
|
6
6
|
console.log(`Connecting to ${addr}`);
|
|
7
7
|
const ws = new WebSocket(addr);
|
|
8
8
|
const channel = new WebSocketConn(ws, 'outbound');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MessageType } from
|
|
1
|
+
import type { MessageType } from "@aptre/protobuf-es-lite";
|
|
2
2
|
export declare const protobufPackage = "rpcstream";
|
|
3
3
|
/**
|
|
4
4
|
* RpcStreamInit is the first message in a RPC stream.
|
|
@@ -48,7 +48,7 @@ export interface RpcStreamPacket {
|
|
|
48
48
|
* @generated from field: rpcstream.RpcStreamInit init = 1;
|
|
49
49
|
*/
|
|
50
50
|
value: RpcStreamInit;
|
|
51
|
-
case:
|
|
51
|
+
case: "init";
|
|
52
52
|
} | {
|
|
53
53
|
/**
|
|
54
54
|
* Ack is sent in response to Init.
|
|
@@ -57,7 +57,7 @@ export interface RpcStreamPacket {
|
|
|
57
57
|
* @generated from field: rpcstream.RpcAck ack = 2;
|
|
58
58
|
*/
|
|
59
59
|
value: RpcAck;
|
|
60
|
-
case:
|
|
60
|
+
case: "ack";
|
|
61
61
|
} | {
|
|
62
62
|
/**
|
|
63
63
|
* Data is the encapsulated data packet.
|
|
@@ -65,7 +65,7 @@ export interface RpcStreamPacket {
|
|
|
65
65
|
* @generated from field: bytes data = 3;
|
|
66
66
|
*/
|
|
67
67
|
value: Uint8Array;
|
|
68
|
-
case:
|
|
68
|
+
case: "data";
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
export declare const RpcStreamPacket: MessageType<RpcStreamPacket>;
|
|
@@ -1,37 +1,34 @@
|
|
|
1
1
|
// @generated by protoc-gen-es-lite unknown with parameter "target=ts,ts_nocheck=false"
|
|
2
2
|
// @generated from file github.com/aperturerobotics/starpc/rpcstream/rpcstream.proto (package rpcstream, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
|
-
import { createMessageType, ScalarType } from
|
|
5
|
-
export const protobufPackage =
|
|
4
|
+
import { createMessageType, ScalarType } from "@aptre/protobuf-es-lite";
|
|
5
|
+
export const protobufPackage = "rpcstream";
|
|
6
|
+
;
|
|
6
7
|
// RpcStreamInit contains the message type declaration for RpcStreamInit.
|
|
7
8
|
export const RpcStreamInit = createMessageType({
|
|
8
|
-
typeName:
|
|
9
|
+
typeName: "rpcstream.RpcStreamInit",
|
|
9
10
|
fields: [
|
|
10
|
-
{ no: 1, name:
|
|
11
|
+
{ no: 1, name: "component_id", kind: "scalar", T: ScalarType.STRING },
|
|
11
12
|
],
|
|
12
13
|
packedByDefault: true,
|
|
13
14
|
});
|
|
15
|
+
;
|
|
14
16
|
// RpcAck contains the message type declaration for RpcAck.
|
|
15
17
|
export const RpcAck = createMessageType({
|
|
16
|
-
typeName:
|
|
18
|
+
typeName: "rpcstream.RpcAck",
|
|
17
19
|
fields: [
|
|
18
|
-
{ no: 1, name:
|
|
20
|
+
{ no: 1, name: "error", kind: "scalar", T: ScalarType.STRING },
|
|
19
21
|
],
|
|
20
22
|
packedByDefault: true,
|
|
21
23
|
});
|
|
24
|
+
;
|
|
22
25
|
// RpcStreamPacket contains the message type declaration for RpcStreamPacket.
|
|
23
26
|
export const RpcStreamPacket = createMessageType({
|
|
24
|
-
typeName:
|
|
27
|
+
typeName: "rpcstream.RpcStreamPacket",
|
|
25
28
|
fields: [
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
kind: 'message',
|
|
30
|
-
T: () => RpcStreamInit,
|
|
31
|
-
oneof: 'body',
|
|
32
|
-
},
|
|
33
|
-
{ no: 2, name: 'ack', kind: 'message', T: () => RpcAck, oneof: 'body' },
|
|
34
|
-
{ no: 3, name: 'data', kind: 'scalar', T: ScalarType.BYTES, oneof: 'body' },
|
|
29
|
+
{ no: 1, name: "init", kind: "message", T: () => RpcStreamInit, oneof: "body" },
|
|
30
|
+
{ no: 2, name: "ack", kind: "message", T: () => RpcAck, oneof: "body" },
|
|
31
|
+
{ no: 3, name: "data", kind: "scalar", T: ScalarType.BYTES, oneof: "body" },
|
|
35
32
|
],
|
|
36
33
|
packedByDefault: true,
|
|
37
34
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MessageType } from
|
|
1
|
+
import type { MessageType } from "@aptre/protobuf-es-lite";
|
|
2
2
|
export declare const protobufPackage = "srpc";
|
|
3
3
|
/**
|
|
4
4
|
* CallStart requests starting a new RPC call.
|
|
@@ -89,7 +89,7 @@ export interface Packet {
|
|
|
89
89
|
* @generated from field: srpc.CallStart call_start = 1;
|
|
90
90
|
*/
|
|
91
91
|
value: CallStart;
|
|
92
|
-
case:
|
|
92
|
+
case: "callStart";
|
|
93
93
|
} | {
|
|
94
94
|
/**
|
|
95
95
|
* CallData is a message in a streaming RPC sequence.
|
|
@@ -97,7 +97,7 @@ export interface Packet {
|
|
|
97
97
|
* @generated from field: srpc.CallData call_data = 2;
|
|
98
98
|
*/
|
|
99
99
|
value: CallData;
|
|
100
|
-
case:
|
|
100
|
+
case: "callData";
|
|
101
101
|
} | {
|
|
102
102
|
/**
|
|
103
103
|
* CallCancel cancels the call.
|
|
@@ -105,7 +105,7 @@ export interface Packet {
|
|
|
105
105
|
* @generated from field: bool call_cancel = 3;
|
|
106
106
|
*/
|
|
107
107
|
value: boolean;
|
|
108
|
-
case:
|
|
108
|
+
case: "callCancel";
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
export declare const Packet: MessageType<Packet>;
|
package/dist/srpc/rpcproto.pb.js
CHANGED
|
@@ -1,55 +1,40 @@
|
|
|
1
1
|
// @generated by protoc-gen-es-lite unknown with parameter "target=ts,ts_nocheck=false"
|
|
2
2
|
// @generated from file github.com/aperturerobotics/starpc/srpc/rpcproto.proto (package srpc, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
|
-
import { createMessageType, ScalarType } from
|
|
5
|
-
export const protobufPackage =
|
|
4
|
+
import { createMessageType, ScalarType } from "@aptre/protobuf-es-lite";
|
|
5
|
+
export const protobufPackage = "srpc";
|
|
6
|
+
;
|
|
6
7
|
// CallStart contains the message type declaration for CallStart.
|
|
7
8
|
export const CallStart = createMessageType({
|
|
8
|
-
typeName:
|
|
9
|
+
typeName: "srpc.CallStart",
|
|
9
10
|
fields: [
|
|
10
|
-
{ no: 1, name:
|
|
11
|
-
{ no: 2, name:
|
|
12
|
-
{ no: 3, name:
|
|
13
|
-
{ no: 4, name:
|
|
11
|
+
{ no: 1, name: "rpc_service", kind: "scalar", T: ScalarType.STRING },
|
|
12
|
+
{ no: 2, name: "rpc_method", kind: "scalar", T: ScalarType.STRING },
|
|
13
|
+
{ no: 3, name: "data", kind: "scalar", T: ScalarType.BYTES },
|
|
14
|
+
{ no: 4, name: "data_is_zero", kind: "scalar", T: ScalarType.BOOL },
|
|
14
15
|
],
|
|
15
16
|
packedByDefault: true,
|
|
16
17
|
});
|
|
18
|
+
;
|
|
17
19
|
// CallData contains the message type declaration for CallData.
|
|
18
20
|
export const CallData = createMessageType({
|
|
19
|
-
typeName:
|
|
21
|
+
typeName: "srpc.CallData",
|
|
20
22
|
fields: [
|
|
21
|
-
{ no: 1, name:
|
|
22
|
-
{ no: 2, name:
|
|
23
|
-
{ no: 3, name:
|
|
24
|
-
{ no: 4, name:
|
|
23
|
+
{ no: 1, name: "data", kind: "scalar", T: ScalarType.BYTES },
|
|
24
|
+
{ no: 2, name: "data_is_zero", kind: "scalar", T: ScalarType.BOOL },
|
|
25
|
+
{ no: 3, name: "complete", kind: "scalar", T: ScalarType.BOOL },
|
|
26
|
+
{ no: 4, name: "error", kind: "scalar", T: ScalarType.STRING },
|
|
25
27
|
],
|
|
26
28
|
packedByDefault: true,
|
|
27
29
|
});
|
|
30
|
+
;
|
|
28
31
|
// Packet contains the message type declaration for Packet.
|
|
29
32
|
export const Packet = createMessageType({
|
|
30
|
-
typeName:
|
|
33
|
+
typeName: "srpc.Packet",
|
|
31
34
|
fields: [
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
kind: 'message',
|
|
36
|
-
T: () => CallStart,
|
|
37
|
-
oneof: 'body',
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
no: 2,
|
|
41
|
-
name: 'call_data',
|
|
42
|
-
kind: 'message',
|
|
43
|
-
T: () => CallData,
|
|
44
|
-
oneof: 'body',
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
no: 3,
|
|
48
|
-
name: 'call_cancel',
|
|
49
|
-
kind: 'scalar',
|
|
50
|
-
T: ScalarType.BOOL,
|
|
51
|
-
oneof: 'body',
|
|
52
|
-
},
|
|
35
|
+
{ no: 1, name: "call_start", kind: "message", T: () => CallStart, oneof: "body" },
|
|
36
|
+
{ no: 2, name: "call_data", kind: "message", T: () => CallData, oneof: "body" },
|
|
37
|
+
{ no: 3, name: "call_cancel", kind: "scalar", T: ScalarType.BOOL, oneof: "body" },
|
|
53
38
|
],
|
|
54
39
|
packedByDefault: true,
|
|
55
40
|
});
|
package/echo/echo.pb.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// @generated from file github.com/aperturerobotics/starpc/echo/echo.proto (package echo, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
|
|
5
|
-
import type { MessageType, PartialFieldInfo } from
|
|
6
|
-
import { createMessageType, ScalarType } from
|
|
5
|
+
import type { MessageType, PartialFieldInfo } from "@aptre/protobuf-es-lite";
|
|
6
|
+
import { createMessageType, ScalarType } from "@aptre/protobuf-es-lite";
|
|
7
7
|
|
|
8
|
-
export const protobufPackage =
|
|
8
|
+
export const protobufPackage = "echo";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* EchoMsg is the message body for Echo.
|
|
@@ -16,14 +16,16 @@ export interface EchoMsg {
|
|
|
16
16
|
/**
|
|
17
17
|
* @generated from field: string body = 1;
|
|
18
18
|
*/
|
|
19
|
-
body?: string
|
|
20
|
-
|
|
19
|
+
body?: string;
|
|
20
|
+
|
|
21
|
+
};
|
|
21
22
|
|
|
22
23
|
// EchoMsg contains the message type declaration for EchoMsg.
|
|
23
24
|
export const EchoMsg: MessageType<EchoMsg> = createMessageType({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
})
|
|
25
|
+
typeName: "echo.EchoMsg",
|
|
26
|
+
fields: [
|
|
27
|
+
{ no: 1, name: "body", kind: "scalar", T: ScalarType.STRING },
|
|
28
|
+
] as readonly PartialFieldInfo[],
|
|
29
|
+
packedByDefault: true,
|
|
30
|
+
});
|
|
31
|
+
|
package/echo/echo_srpc.pb.ts
CHANGED
|
@@ -2,15 +2,10 @@
|
|
|
2
2
|
// @generated from file github.com/aperturerobotics/starpc/echo/echo.proto (package echo, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
|
|
5
|
-
import { EchoMsg } from
|
|
6
|
-
import { Empty, MethodKind } from
|
|
7
|
-
import { RpcStreamPacket } from
|
|
8
|
-
import {
|
|
9
|
-
buildDecodeMessageTransform,
|
|
10
|
-
buildEncodeMessageTransform,
|
|
11
|
-
MessageStream,
|
|
12
|
-
ProtoRpc,
|
|
13
|
-
} from 'starpc'
|
|
5
|
+
import { EchoMsg } from "./echo.pb.js";
|
|
6
|
+
import { Empty, MethodKind } from "@aptre/protobuf-es-lite";
|
|
7
|
+
import { RpcStreamPacket } from "../rpcstream/rpcstream.pb.js";
|
|
8
|
+
import { buildDecodeMessageTransform, buildEncodeMessageTransform, MessageStream, ProtoRpc } from "starpc";
|
|
14
9
|
|
|
15
10
|
/**
|
|
16
11
|
* Echoer service returns the given message.
|
|
@@ -18,7 +13,7 @@ import {
|
|
|
18
13
|
* @generated from service echo.Echoer
|
|
19
14
|
*/
|
|
20
15
|
export const EchoerDefinition = {
|
|
21
|
-
typeName:
|
|
16
|
+
typeName: "echo.Echoer",
|
|
22
17
|
methods: {
|
|
23
18
|
/**
|
|
24
19
|
* Echo returns the given message.
|
|
@@ -26,7 +21,7 @@ export const EchoerDefinition = {
|
|
|
26
21
|
* @generated from rpc echo.Echoer.Echo
|
|
27
22
|
*/
|
|
28
23
|
Echo: {
|
|
29
|
-
name:
|
|
24
|
+
name: "Echo",
|
|
30
25
|
I: EchoMsg,
|
|
31
26
|
O: EchoMsg,
|
|
32
27
|
kind: MethodKind.Unary,
|
|
@@ -37,7 +32,7 @@ export const EchoerDefinition = {
|
|
|
37
32
|
* @generated from rpc echo.Echoer.EchoServerStream
|
|
38
33
|
*/
|
|
39
34
|
EchoServerStream: {
|
|
40
|
-
name:
|
|
35
|
+
name: "EchoServerStream",
|
|
41
36
|
I: EchoMsg,
|
|
42
37
|
O: EchoMsg,
|
|
43
38
|
kind: MethodKind.ServerStreaming,
|
|
@@ -48,7 +43,7 @@ export const EchoerDefinition = {
|
|
|
48
43
|
* @generated from rpc echo.Echoer.EchoClientStream
|
|
49
44
|
*/
|
|
50
45
|
EchoClientStream: {
|
|
51
|
-
name:
|
|
46
|
+
name: "EchoClientStream",
|
|
52
47
|
I: EchoMsg,
|
|
53
48
|
O: EchoMsg,
|
|
54
49
|
kind: MethodKind.ClientStreaming,
|
|
@@ -59,7 +54,7 @@ export const EchoerDefinition = {
|
|
|
59
54
|
* @generated from rpc echo.Echoer.EchoBidiStream
|
|
60
55
|
*/
|
|
61
56
|
EchoBidiStream: {
|
|
62
|
-
name:
|
|
57
|
+
name: "EchoBidiStream",
|
|
63
58
|
I: EchoMsg,
|
|
64
59
|
O: EchoMsg,
|
|
65
60
|
kind: MethodKind.BiDiStreaming,
|
|
@@ -70,7 +65,7 @@ export const EchoerDefinition = {
|
|
|
70
65
|
* @generated from rpc echo.Echoer.RpcStream
|
|
71
66
|
*/
|
|
72
67
|
RpcStream: {
|
|
73
|
-
name:
|
|
68
|
+
name: "RpcStream",
|
|
74
69
|
I: RpcStreamPacket,
|
|
75
70
|
O: RpcStreamPacket,
|
|
76
71
|
kind: MethodKind.BiDiStreaming,
|
|
@@ -81,13 +76,13 @@ export const EchoerDefinition = {
|
|
|
81
76
|
* @generated from rpc echo.Echoer.DoNothing
|
|
82
77
|
*/
|
|
83
78
|
DoNothing: {
|
|
84
|
-
name:
|
|
79
|
+
name: "DoNothing",
|
|
85
80
|
I: Empty,
|
|
86
81
|
O: Empty,
|
|
87
82
|
kind: MethodKind.Unary,
|
|
88
83
|
},
|
|
89
|
-
}
|
|
90
|
-
} as const
|
|
84
|
+
}
|
|
85
|
+
} as const;
|
|
91
86
|
|
|
92
87
|
/**
|
|
93
88
|
* Echoer service returns the given message.
|
|
@@ -100,7 +95,10 @@ export interface Echoer {
|
|
|
100
95
|
*
|
|
101
96
|
* @generated from rpc echo.Echoer.Echo
|
|
102
97
|
*/
|
|
103
|
-
Echo(
|
|
98
|
+
Echo(
|
|
99
|
+
request: EchoMsg, abortSignal?: AbortSignal
|
|
100
|
+
):
|
|
101
|
+
Promise<EchoMsg>
|
|
104
102
|
|
|
105
103
|
/**
|
|
106
104
|
* EchoServerStream is an example of a server -> client one-way stream.
|
|
@@ -108,9 +106,9 @@ export interface Echoer {
|
|
|
108
106
|
* @generated from rpc echo.Echoer.EchoServerStream
|
|
109
107
|
*/
|
|
110
108
|
EchoServerStream(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
request: EchoMsg, abortSignal?: AbortSignal
|
|
110
|
+
):
|
|
111
|
+
MessageStream<EchoMsg>
|
|
114
112
|
|
|
115
113
|
/**
|
|
116
114
|
* EchoClientStream is an example of client->server one-way stream.
|
|
@@ -118,9 +116,9 @@ export interface Echoer {
|
|
|
118
116
|
* @generated from rpc echo.Echoer.EchoClientStream
|
|
119
117
|
*/
|
|
120
118
|
EchoClientStream(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
request: MessageStream<EchoMsg>, abortSignal?: AbortSignal
|
|
120
|
+
):
|
|
121
|
+
Promise<EchoMsg>
|
|
124
122
|
|
|
125
123
|
/**
|
|
126
124
|
* EchoBidiStream is an example of a two-way stream.
|
|
@@ -128,9 +126,9 @@ export interface Echoer {
|
|
|
128
126
|
* @generated from rpc echo.Echoer.EchoBidiStream
|
|
129
127
|
*/
|
|
130
128
|
EchoBidiStream(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
request: MessageStream<EchoMsg>, abortSignal?: AbortSignal
|
|
130
|
+
):
|
|
131
|
+
MessageStream<EchoMsg>
|
|
134
132
|
|
|
135
133
|
/**
|
|
136
134
|
* RpcStream opens a nested rpc call stream.
|
|
@@ -138,16 +136,20 @@ export interface Echoer {
|
|
|
138
136
|
* @generated from rpc echo.Echoer.RpcStream
|
|
139
137
|
*/
|
|
140
138
|
RpcStream(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
139
|
+
request: MessageStream<RpcStreamPacket>, abortSignal?: AbortSignal
|
|
140
|
+
):
|
|
141
|
+
MessageStream<RpcStreamPacket>
|
|
144
142
|
|
|
145
143
|
/**
|
|
146
144
|
* DoNothing does nothing.
|
|
147
145
|
*
|
|
148
146
|
* @generated from rpc echo.Echoer.DoNothing
|
|
149
147
|
*/
|
|
150
|
-
DoNothing(
|
|
148
|
+
DoNothing(
|
|
149
|
+
request: Empty, abortSignal?: AbortSignal
|
|
150
|
+
):
|
|
151
|
+
Promise<Empty>
|
|
152
|
+
|
|
151
153
|
}
|
|
152
154
|
|
|
153
155
|
export const EchoerServiceName = EchoerDefinition.typeName
|
|
@@ -170,7 +172,10 @@ export class EchoerClient implements Echoer {
|
|
|
170
172
|
*
|
|
171
173
|
* @generated from rpc echo.Echoer.Echo
|
|
172
174
|
*/
|
|
173
|
-
async Echo(
|
|
175
|
+
async Echo(
|
|
176
|
+
request: EchoMsg, abortSignal?: AbortSignal
|
|
177
|
+
):
|
|
178
|
+
Promise<EchoMsg> {
|
|
174
179
|
const requestMsg = EchoMsg.create(request)
|
|
175
180
|
const result = await this.rpc.request(
|
|
176
181
|
this.service,
|
|
@@ -187,9 +192,9 @@ export class EchoerClient implements Echoer {
|
|
|
187
192
|
* @generated from rpc echo.Echoer.EchoServerStream
|
|
188
193
|
*/
|
|
189
194
|
EchoServerStream(
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
195
|
+
request: EchoMsg, abortSignal?: AbortSignal
|
|
196
|
+
):
|
|
197
|
+
MessageStream<EchoMsg> {
|
|
193
198
|
const requestMsg = EchoMsg.create(request)
|
|
194
199
|
const result = this.rpc.serverStreamingRequest(
|
|
195
200
|
this.service,
|
|
@@ -206,9 +211,9 @@ export class EchoerClient implements Echoer {
|
|
|
206
211
|
* @generated from rpc echo.Echoer.EchoClientStream
|
|
207
212
|
*/
|
|
208
213
|
async EchoClientStream(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
214
|
+
request: MessageStream<EchoMsg>, abortSignal?: AbortSignal
|
|
215
|
+
):
|
|
216
|
+
Promise<EchoMsg> {
|
|
212
217
|
const result = await this.rpc.clientStreamingRequest(
|
|
213
218
|
this.service,
|
|
214
219
|
EchoerDefinition.methods.EchoClientStream.name,
|
|
@@ -224,9 +229,9 @@ export class EchoerClient implements Echoer {
|
|
|
224
229
|
* @generated from rpc echo.Echoer.EchoBidiStream
|
|
225
230
|
*/
|
|
226
231
|
EchoBidiStream(
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
232
|
+
request: MessageStream<EchoMsg>, abortSignal?: AbortSignal
|
|
233
|
+
):
|
|
234
|
+
MessageStream<EchoMsg> {
|
|
230
235
|
const result = this.rpc.bidirectionalStreamingRequest(
|
|
231
236
|
this.service,
|
|
232
237
|
EchoerDefinition.methods.EchoBidiStream.name,
|
|
@@ -242,9 +247,9 @@ export class EchoerClient implements Echoer {
|
|
|
242
247
|
* @generated from rpc echo.Echoer.RpcStream
|
|
243
248
|
*/
|
|
244
249
|
RpcStream(
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
250
|
+
request: MessageStream<RpcStreamPacket>, abortSignal?: AbortSignal
|
|
251
|
+
):
|
|
252
|
+
MessageStream<RpcStreamPacket> {
|
|
248
253
|
const result = this.rpc.bidirectionalStreamingRequest(
|
|
249
254
|
this.service,
|
|
250
255
|
EchoerDefinition.methods.RpcStream.name,
|
|
@@ -259,7 +264,10 @@ export class EchoerClient implements Echoer {
|
|
|
259
264
|
*
|
|
260
265
|
* @generated from rpc echo.Echoer.DoNothing
|
|
261
266
|
*/
|
|
262
|
-
async DoNothing(
|
|
267
|
+
async DoNothing(
|
|
268
|
+
request: Empty, abortSignal?: AbortSignal
|
|
269
|
+
):
|
|
270
|
+
Promise<Empty> {
|
|
263
271
|
const requestMsg = Empty.create(request)
|
|
264
272
|
const result = await this.rpc.request(
|
|
265
273
|
this.service,
|
|
@@ -269,4 +277,5 @@ export class EchoerClient implements Echoer {
|
|
|
269
277
|
)
|
|
270
278
|
return Empty.fromBinary(result)
|
|
271
279
|
}
|
|
280
|
+
|
|
272
281
|
}
|
package/go.mod
CHANGED
|
@@ -2,19 +2,19 @@ module github.com/aperturerobotics/starpc
|
|
|
2
2
|
|
|
3
3
|
go 1.23
|
|
4
4
|
|
|
5
|
-
toolchain go1.23.
|
|
5
|
+
toolchain go1.23.3
|
|
6
6
|
|
|
7
7
|
replace (
|
|
8
8
|
// This fork uses go-protobuf-lite and adds post-quantum crypto support.
|
|
9
|
-
github.com/libp2p/go-libp2p => github.com/aperturerobotics/go-libp2p v0.
|
|
9
|
+
github.com/libp2p/go-libp2p => github.com/aperturerobotics/go-libp2p v0.37.1-0.20241111002741-5cfbb50b74e0 // aperture
|
|
10
10
|
|
|
11
11
|
// This fork uses go-protobuf-lite.
|
|
12
12
|
github.com/libp2p/go-msgio => github.com/aperturerobotics/go-libp2p-msgio v0.0.0-20240511033615-1b69178aa5c8 // aperture
|
|
13
13
|
)
|
|
14
14
|
|
|
15
15
|
require (
|
|
16
|
-
github.com/aperturerobotics/protobuf-go-lite v0.
|
|
17
|
-
github.com/aperturerobotics/util v1.26.
|
|
16
|
+
github.com/aperturerobotics/protobuf-go-lite v0.8.0 // latest
|
|
17
|
+
github.com/aperturerobotics/util v1.26.2 // latest
|
|
18
18
|
)
|
|
19
19
|
|
|
20
20
|
require (
|
|
@@ -23,12 +23,11 @@ require (
|
|
|
23
23
|
github.com/libp2p/go-yamux/v4 v4.0.2-0.20240826150533-e92055b23e0e // master
|
|
24
24
|
github.com/pkg/errors v0.9.1 // latest
|
|
25
25
|
github.com/sirupsen/logrus v1.9.3 // latest
|
|
26
|
-
google.golang.org/protobuf v1.35.
|
|
26
|
+
google.golang.org/protobuf v1.35.2 // latest
|
|
27
27
|
)
|
|
28
28
|
|
|
29
29
|
require (
|
|
30
30
|
github.com/aperturerobotics/json-iterator-lite v1.0.0 // indirect
|
|
31
|
-
github.com/cloudflare/circl v1.3.8 // indirect
|
|
32
31
|
github.com/ipfs/go-cid v0.4.1 // indirect
|
|
33
32
|
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
|
|
34
33
|
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
|
|
@@ -42,8 +41,8 @@ require (
|
|
|
42
41
|
github.com/multiformats/go-multistream v0.5.0 // indirect
|
|
43
42
|
github.com/multiformats/go-varint v0.0.7 // indirect
|
|
44
43
|
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
|
45
|
-
golang.org/x/crypto v0.
|
|
44
|
+
golang.org/x/crypto v0.29.0 // indirect
|
|
46
45
|
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect
|
|
47
|
-
golang.org/x/sys v0.
|
|
46
|
+
golang.org/x/sys v0.27.0 // indirect
|
|
48
47
|
lukechampine.com/blake3 v1.3.0 // indirect
|
|
49
48
|
)
|
package/go.sum
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
github.com/aperturerobotics/go-libp2p v0.
|
|
2
|
-
github.com/aperturerobotics/go-libp2p v0.
|
|
1
|
+
github.com/aperturerobotics/go-libp2p v0.37.1-0.20241111002741-5cfbb50b74e0 h1:tGwbeDoEeQCrUQL+ClUywldqvz9eRmhcVrGwGxz2xJg=
|
|
2
|
+
github.com/aperturerobotics/go-libp2p v0.37.1-0.20241111002741-5cfbb50b74e0/go.mod h1:FJkAtQcP9XxqG1NNLNHKm+wLVIGSCQX2s6CEoD+w97g=
|
|
3
3
|
github.com/aperturerobotics/json-iterator-lite v1.0.0 h1:cihbrYWoK/S2RYXhJLpDZd+GUjVvFJN+D3w1VOqqHRI=
|
|
4
4
|
github.com/aperturerobotics/json-iterator-lite v1.0.0/go.mod h1:snaApCEDtrHHP6UWSLKiYNOZU9A5NyzccKenx9oZEzg=
|
|
5
|
-
github.com/aperturerobotics/protobuf-go-lite v0.
|
|
6
|
-
github.com/aperturerobotics/protobuf-go-lite v0.
|
|
7
|
-
github.com/aperturerobotics/util v1.26.
|
|
8
|
-
github.com/aperturerobotics/util v1.26.
|
|
9
|
-
github.com/cloudflare/circl v1.3.8 h1:j+V8jJt09PoeMFIu2uh5JUyEaIHTXVOHslFoLNAKqwI=
|
|
10
|
-
github.com/cloudflare/circl v1.3.8/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU=
|
|
5
|
+
github.com/aperturerobotics/protobuf-go-lite v0.8.0 h1:SoiTAVArmOrNTX31e6CC5Bem6HuOElg3YYNhp4AAPQc=
|
|
6
|
+
github.com/aperturerobotics/protobuf-go-lite v0.8.0/go.mod h1:y49wVEezRHg78uQ2OzLLZbtTTWuox+ChmaTuh6FLJW8=
|
|
7
|
+
github.com/aperturerobotics/util v1.26.2 h1:PrBgJ3ydAwSD59o7s5zRfL+mbphIC6xo2Inor7/K+ok=
|
|
8
|
+
github.com/aperturerobotics/util v1.26.2/go.mod h1:jp9+cf8cTlX5Jf0F9RlXmKtEw0yXC6gU92V9lXoZ74M=
|
|
11
9
|
github.com/coder/websocket v1.8.12 h1:5bUXkEPPIbewrnkU8LTCLVaxi4N4J8ahufH2vlo4NAo=
|
|
12
10
|
github.com/coder/websocket v1.8.12/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs=
|
|
13
11
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
@@ -55,16 +53,16 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
|
|
55
53
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
|
56
54
|
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
|
57
55
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
|
58
|
-
golang.org/x/crypto v0.
|
|
59
|
-
golang.org/x/crypto v0.
|
|
56
|
+
golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
|
|
57
|
+
golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
|
|
60
58
|
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY=
|
|
61
59
|
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8=
|
|
62
60
|
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
63
61
|
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
64
|
-
golang.org/x/sys v0.
|
|
65
|
-
golang.org/x/sys v0.
|
|
66
|
-
google.golang.org/protobuf v1.35.
|
|
67
|
-
google.golang.org/protobuf v1.35.
|
|
62
|
+
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
|
|
63
|
+
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
|
64
|
+
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
|
|
65
|
+
google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
|
68
66
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
|
69
67
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
|
70
68
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
|
@@ -17,15 +17,15 @@ func main() {
|
|
|
17
17
|
logrus.Fatal(err.Error())
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
// listen at: ws://localhost:
|
|
20
|
+
// listen at: ws://localhost:4352/demo
|
|
21
21
|
server, err := srpc.NewHTTPServer(mux, "/demo")
|
|
22
22
|
if err != nil {
|
|
23
23
|
logrus.Fatal(err.Error())
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
fmt.Print("listening on localhost:
|
|
26
|
+
fmt.Print("listening on localhost:4352\n")
|
|
27
27
|
hserver := &http.Server{
|
|
28
|
-
Addr: "localhost:
|
|
28
|
+
Addr: "localhost:4352",
|
|
29
29
|
Handler: server,
|
|
30
30
|
ReadHeaderTimeout: time.Second * 10,
|
|
31
31
|
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import WebSocket from 'isomorphic-ws'
|
|
8
8
|
|
|
9
9
|
async function runRPC() {
|
|
10
|
-
const addr = 'ws://localhost:
|
|
10
|
+
const addr = 'ws://localhost:4352/demo'
|
|
11
11
|
console.log(`Connecting to ${addr}`)
|
|
12
12
|
const ws = new WebSocket(addr)
|
|
13
13
|
const channel = new WebSocketConn(ws, 'outbound')
|
package/package.json
CHANGED
package/srpc/rpcproto.pb.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// @generated from file github.com/aperturerobotics/starpc/srpc/rpcproto.proto (package srpc, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
4
|
|
|
5
|
-
import type { MessageType, PartialFieldInfo } from
|
|
6
|
-
import { createMessageType, ScalarType } from
|
|
5
|
+
import type { MessageType, PartialFieldInfo } from "@aptre/protobuf-es-lite";
|
|
6
|
+
import { createMessageType, ScalarType } from "@aptre/protobuf-es-lite";
|
|
7
7
|
|
|
8
|
-
export const protobufPackage =
|
|
8
|
+
export const protobufPackage = "srpc";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* CallStart requests starting a new RPC call.
|
|
@@ -19,40 +19,41 @@ export interface CallStart {
|
|
|
19
19
|
*
|
|
20
20
|
* @generated from field: string rpc_service = 1;
|
|
21
21
|
*/
|
|
22
|
-
rpcService?: string
|
|
22
|
+
rpcService?: string;
|
|
23
23
|
/**
|
|
24
24
|
* RpcMethod is the RPC method to call.
|
|
25
25
|
* Must be set.
|
|
26
26
|
*
|
|
27
27
|
* @generated from field: string rpc_method = 2;
|
|
28
28
|
*/
|
|
29
|
-
rpcMethod?: string
|
|
29
|
+
rpcMethod?: string;
|
|
30
30
|
/**
|
|
31
31
|
* Data contains the request or the first message in the stream.
|
|
32
32
|
* Optional if streaming.
|
|
33
33
|
*
|
|
34
34
|
* @generated from field: bytes data = 3;
|
|
35
35
|
*/
|
|
36
|
-
data?: Uint8Array
|
|
36
|
+
data?: Uint8Array;
|
|
37
37
|
/**
|
|
38
38
|
* DataIsZero indicates Data is set with an empty message.
|
|
39
39
|
*
|
|
40
40
|
* @generated from field: bool data_is_zero = 4;
|
|
41
41
|
*/
|
|
42
|
-
dataIsZero?: boolean
|
|
43
|
-
|
|
42
|
+
dataIsZero?: boolean;
|
|
43
|
+
|
|
44
|
+
};
|
|
44
45
|
|
|
45
46
|
// CallStart contains the message type declaration for CallStart.
|
|
46
47
|
export const CallStart: MessageType<CallStart> = createMessageType({
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
})
|
|
48
|
+
typeName: "srpc.CallStart",
|
|
49
|
+
fields: [
|
|
50
|
+
{ no: 1, name: "rpc_service", kind: "scalar", T: ScalarType.STRING },
|
|
51
|
+
{ no: 2, name: "rpc_method", kind: "scalar", T: ScalarType.STRING },
|
|
52
|
+
{ no: 3, name: "data", kind: "scalar", T: ScalarType.BYTES },
|
|
53
|
+
{ no: 4, name: "data_is_zero", kind: "scalar", T: ScalarType.BOOL },
|
|
54
|
+
] as readonly PartialFieldInfo[],
|
|
55
|
+
packedByDefault: true,
|
|
56
|
+
});
|
|
56
57
|
|
|
57
58
|
/**
|
|
58
59
|
* CallData contains a message in a streaming RPC sequence.
|
|
@@ -65,39 +66,40 @@ export interface CallData {
|
|
|
65
66
|
*
|
|
66
67
|
* @generated from field: bytes data = 1;
|
|
67
68
|
*/
|
|
68
|
-
data?: Uint8Array
|
|
69
|
+
data?: Uint8Array;
|
|
69
70
|
/**
|
|
70
71
|
* DataIsZero indicates Data is set with an empty message.
|
|
71
72
|
*
|
|
72
73
|
* @generated from field: bool data_is_zero = 2;
|
|
73
74
|
*/
|
|
74
|
-
dataIsZero?: boolean
|
|
75
|
+
dataIsZero?: boolean;
|
|
75
76
|
/**
|
|
76
77
|
* Complete indicates the RPC call is completed.
|
|
77
78
|
*
|
|
78
79
|
* @generated from field: bool complete = 3;
|
|
79
80
|
*/
|
|
80
|
-
complete?: boolean
|
|
81
|
+
complete?: boolean;
|
|
81
82
|
/**
|
|
82
83
|
* Error contains any error that caused the RPC to fail.
|
|
83
84
|
* If set, implies complete=true.
|
|
84
85
|
*
|
|
85
86
|
* @generated from field: string error = 4;
|
|
86
87
|
*/
|
|
87
|
-
error?: string
|
|
88
|
-
|
|
88
|
+
error?: string;
|
|
89
|
+
|
|
90
|
+
};
|
|
89
91
|
|
|
90
92
|
// CallData contains the message type declaration for CallData.
|
|
91
93
|
export const CallData: MessageType<CallData> = createMessageType({
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
})
|
|
94
|
+
typeName: "srpc.CallData",
|
|
95
|
+
fields: [
|
|
96
|
+
{ no: 1, name: "data", kind: "scalar", T: ScalarType.BYTES },
|
|
97
|
+
{ no: 2, name: "data_is_zero", kind: "scalar", T: ScalarType.BOOL },
|
|
98
|
+
{ no: 3, name: "complete", kind: "scalar", T: ScalarType.BOOL },
|
|
99
|
+
{ no: 4, name: "error", kind: "scalar", T: ScalarType.STRING },
|
|
100
|
+
] as readonly PartialFieldInfo[],
|
|
101
|
+
packedByDefault: true,
|
|
102
|
+
});
|
|
101
103
|
|
|
102
104
|
/**
|
|
103
105
|
* Packet is a message sent over a srpc packet connection.
|
|
@@ -105,70 +107,51 @@ export const CallData: MessageType<CallData> = createMessageType({
|
|
|
105
107
|
* @generated from message srpc.Packet
|
|
106
108
|
*/
|
|
107
109
|
export interface Packet {
|
|
110
|
+
|
|
108
111
|
/**
|
|
109
112
|
* Body is the packet body.
|
|
110
113
|
*
|
|
111
114
|
* @generated from oneof srpc.Packet.body
|
|
112
115
|
*/
|
|
113
|
-
body?:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
case: 'callCancel'
|
|
144
|
-
}
|
|
145
|
-
}
|
|
116
|
+
body?: {
|
|
117
|
+
value?: undefined,
|
|
118
|
+
case: undefined
|
|
119
|
+
} | {
|
|
120
|
+
/**
|
|
121
|
+
* CallStart initiates a new call.
|
|
122
|
+
*
|
|
123
|
+
* @generated from field: srpc.CallStart call_start = 1;
|
|
124
|
+
*/
|
|
125
|
+
value: CallStart;
|
|
126
|
+
case: "callStart";
|
|
127
|
+
} | {
|
|
128
|
+
/**
|
|
129
|
+
* CallData is a message in a streaming RPC sequence.
|
|
130
|
+
*
|
|
131
|
+
* @generated from field: srpc.CallData call_data = 2;
|
|
132
|
+
*/
|
|
133
|
+
value: CallData;
|
|
134
|
+
case: "callData";
|
|
135
|
+
} | {
|
|
136
|
+
/**
|
|
137
|
+
* CallCancel cancels the call.
|
|
138
|
+
*
|
|
139
|
+
* @generated from field: bool call_cancel = 3;
|
|
140
|
+
*/
|
|
141
|
+
value: boolean;
|
|
142
|
+
case: "callCancel";
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
};
|
|
146
146
|
|
|
147
147
|
// Packet contains the message type declaration for Packet.
|
|
148
148
|
export const Packet: MessageType<Packet> = createMessageType({
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
{
|
|
159
|
-
no: 2,
|
|
160
|
-
name: 'call_data',
|
|
161
|
-
kind: 'message',
|
|
162
|
-
T: () => CallData,
|
|
163
|
-
oneof: 'body',
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
no: 3,
|
|
167
|
-
name: 'call_cancel',
|
|
168
|
-
kind: 'scalar',
|
|
169
|
-
T: ScalarType.BOOL,
|
|
170
|
-
oneof: 'body',
|
|
171
|
-
},
|
|
172
|
-
] as readonly PartialFieldInfo[],
|
|
173
|
-
packedByDefault: true,
|
|
174
|
-
})
|
|
149
|
+
typeName: "srpc.Packet",
|
|
150
|
+
fields: [
|
|
151
|
+
{ no: 1, name: "call_start", kind: "message", T: () => CallStart, oneof: "body" },
|
|
152
|
+
{ no: 2, name: "call_data", kind: "message", T: () => CallData, oneof: "body" },
|
|
153
|
+
{ no: 3, name: "call_cancel", kind: "scalar", T: ScalarType.BOOL, oneof: "body" },
|
|
154
|
+
] as readonly PartialFieldInfo[],
|
|
155
|
+
packedByDefault: true,
|
|
156
|
+
});
|
|
157
|
+
|