go-libp2p-pubsub/pb/rpc.proto

57 lines
1.2 KiB
Protocol Buffer
Raw Normal View History

2018-07-13 09:20:11 -04:00
syntax = "proto2";
package pubsub.pb;
2016-09-10 08:14:17 -07:00
message RPC {
2016-09-10 20:47:12 -07:00
repeated SubOpts subscriptions = 1;
repeated Message publish = 2;
2016-09-10 08:14:17 -07:00
2016-09-10 20:47:12 -07:00
message SubOpts {
optional bool subscribe = 1; // subscribe or unsubcribe
optional string topicid = 2;
}
2018-02-19 17:24:19 +02:00
2018-08-08 10:54:14 -07:00
optional ControlMessage control = 3;
2016-09-10 08:14:17 -07:00
}
message Message {
optional bytes from = 1;
2016-09-10 08:14:17 -07:00
optional bytes data = 2;
2016-09-10 20:47:12 -07:00
optional bytes seqno = 3;
2020-09-29 18:05:54 +03:00
optional string topic = 4;
optional bytes signature = 5;
optional bytes key = 6;
2016-09-10 08:14:17 -07:00
}
2018-02-19 17:24:19 +02:00
message ControlMessage {
2018-08-08 10:54:14 -07:00
repeated ControlIHave ihave = 1;
repeated ControlIWant iwant = 2;
repeated ControlGraft graft = 3;
repeated ControlPrune prune = 4;
2018-02-19 17:24:19 +02:00
}
message ControlIHave {
2018-08-08 10:54:14 -07:00
optional string topicID = 1;
// implementors from other languages should use bytes here - go protobuf emits invalid utf8 strings
2018-08-08 10:54:14 -07:00
repeated string messageIDs = 2;
2018-02-19 17:24:19 +02:00
}
message ControlIWant {
// implementors from other languages should use bytes here - go protobuf emits invalid utf8 strings
2018-08-08 10:54:14 -07:00
repeated string messageIDs = 1;
2018-02-19 17:24:19 +02:00
}
message ControlGraft {
2018-08-08 10:54:14 -07:00
optional string topicID = 1;
2018-02-19 17:24:19 +02:00
}
message ControlPrune {
2018-08-08 10:54:14 -07:00
optional string topicID = 1;
repeated PeerInfo peers = 2;
2020-05-06 20:07:42 +03:00
optional uint64 backoff = 3;
}
message PeerInfo {
optional bytes peerID = 1;
2020-01-22 10:23:47 -05:00
optional bytes signedPeerRecord = 2;
}