forked from araskachoi/go-libp2p-pubsub-benchmark-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublisher.proto
73 lines (59 loc) · 1.75 KB
/
publisher.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
syntax = "proto3";
package pb;
option java_multiple_files = true;
option java_package = "io.grpc.pubsub.benchmark";
option java_outer_classname = "PubsubBenchmark";
import "google/protobuf/empty.proto";
message Message {
string id = 1;
int32 sequence = 2;
bytes data = 3;
}
message PublishReply {
string msgId = 1;
bool success = 2;
}
message CloseAllPeerConnectionsReply {
bool success = 1;
}
message ShutdownReply {
bool success = 1;
}
message PeersList {
repeated string peers = 1;
}
message ClosePeerConnectionsReply {
bool success = 1;
}
message OpenPeerConnectionReply {
bool success = 1;
string peer = 2;
}
message OpenPeersConnectionsReplies {
repeated OpenPeerConnectionReply PeerConnections = 1;
}
message IDReply {
string ID = 1;
}
message ListenAddressesReply {
repeated string Addresses = 1;
}
// The publisher service definition.
service Publisher {
// Publishes a message on the pubsub channel
rpc PublishMessage(Message) returns (PublishReply) {}
// Closes all connections
rpc CloseAllPeerConnections(google.protobuf.Empty) returns (CloseAllPeerConnectionsReply) {}
// Closes connections to listed peers
rpc ClosePeerConnections(PeersList) returns (ClosePeerConnectionsReply) {}
// Opens connections to listed peers
rpc OpenPeersConnections(PeersList) returns (OpenPeersConnectionsReplies) {}
// Lists the host's connected peers
rpc ListConnectedPeers(google.protobuf.Empty) returns (PeersList) {}
// Shuts the host down
rpc Shutdown(google.protobuf.Empty) returns (ShutdownReply) {}
// ID returns the host's id
rpc ID(google.protobuf.Empty) returns (IDReply) {}
// ListenAddresses returns the host's listen addresses
rpc ListenAddresses(google.protobuf.Empty) returns (ListenAddressesReply) {}
}