mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-07 01:08:08 +08:00
35 lines
720 B
Protocol Buffer
35 lines
720 B
Protocol Buffer
package dht;
|
|
|
|
//run `protoc --go_out=. *.proto` to generate
|
|
|
|
message PBDHTMessage {
|
|
enum MessageType {
|
|
PUT_VALUE = 0;
|
|
GET_VALUE = 1;
|
|
ADD_PROVIDER = 2;
|
|
GET_PROVIDERS = 3;
|
|
FIND_NODE = 4;
|
|
PING = 5;
|
|
DIAGNOSTIC = 6;
|
|
}
|
|
|
|
message PBPeer {
|
|
required string id = 1;
|
|
required string addr = 2;
|
|
}
|
|
|
|
required MessageType type = 1;
|
|
optional string key = 2;
|
|
optional bytes value = 3;
|
|
|
|
// Unique ID of this message, used to match queries with responses
|
|
required uint64 id = 4;
|
|
|
|
// Signals whether or not this message is a response to another message
|
|
optional bool response = 5;
|
|
optional bool success = 6;
|
|
|
|
// Used for returning peers from queries (normally, peers closer to X)
|
|
repeated PBPeer peers = 7;
|
|
}
|