rpc.proto 1.2 KB
Newer Older
Preston Van Loon's avatar
Preston Van Loon committed
1 2
syntax = "proto2";

Steven Allen's avatar
Steven Allen committed
3
package pubsub.pb;
Jeromy's avatar
Jeromy committed
4 5

message RPC {
Jeromy's avatar
Jeromy committed
6 7
	repeated SubOpts subscriptions = 1;
	repeated Message publish = 2;
Jeromy's avatar
Jeromy committed
8

Jeromy's avatar
Jeromy committed
9 10 11 12
	message SubOpts {
		optional bool subscribe = 1; // subscribe or unsubcribe
		optional string topicid = 2;
	}
vyzo's avatar
vyzo committed
13

Steven Allen's avatar
Steven Allen committed
14
	optional ControlMessage control = 3;
Jeromy's avatar
Jeromy committed
15 16 17
}

message Message {
18
	optional bytes from = 1;
Jeromy's avatar
Jeromy committed
19
	optional bytes data = 2;
Jeromy's avatar
Jeromy committed
20
	optional bytes seqno = 3;
vyzo's avatar
vyzo committed
21
	optional string topic = 4;
vyzo's avatar
vyzo committed
22 23
	optional bytes signature = 5;
	optional bytes key = 6;
Jeromy's avatar
Jeromy committed
24 25
}

vyzo's avatar
vyzo committed
26
message ControlMessage {
Steven Allen's avatar
Steven Allen committed
27 28 29 30
	repeated ControlIHave ihave = 1;
	repeated ControlIWant iwant = 2;
	repeated ControlGraft graft = 3;
	repeated ControlPrune prune = 4;
vyzo's avatar
vyzo committed
31 32 33
}

message ControlIHave {
Steven Allen's avatar
Steven Allen committed
34
	optional string topicID = 1;
Rüdiger Klaehn's avatar
Rüdiger Klaehn committed
35
	// implementors from other languages should use bytes here - go protobuf emits invalid utf8 strings
Steven Allen's avatar
Steven Allen committed
36
	repeated string messageIDs = 2;
vyzo's avatar
vyzo committed
37 38 39
}

message ControlIWant {
Rüdiger Klaehn's avatar
Rüdiger Klaehn committed
40
	// implementors from other languages should use bytes here - go protobuf emits invalid utf8 strings
Steven Allen's avatar
Steven Allen committed
41
	repeated string messageIDs = 1;
vyzo's avatar
vyzo committed
42 43 44
}

message ControlGraft {
Steven Allen's avatar
Steven Allen committed
45
	optional string topicID = 1;
vyzo's avatar
vyzo committed
46 47 48
}

message ControlPrune {
Steven Allen's avatar
Steven Allen committed
49
	optional string topicID = 1;
50
	repeated PeerInfo peers = 2;
vyzo's avatar
vyzo committed
51
	optional uint64 backoff = 3;
52 53 54 55
}

message PeerInfo {
	optional bytes peerID = 1;
56
	optional bytes signedPeerRecord = 2;
57
}