github.com/zignig/go-ipfs@v0.0.0-20141111235910-c9e5fdf55a52/routing/dht/pb/dht.proto (about)

     1  package dht.pb;
     2  
     3  //run `protoc --go_out=. *.proto` to generate
     4  
     5  message Message {
     6  	enum MessageType {
     7  		PUT_VALUE = 0;
     8  		GET_VALUE = 1;
     9  		ADD_PROVIDER = 2;
    10  		GET_PROVIDERS = 3;
    11  		FIND_NODE = 4;
    12  		PING = 5;
    13  	}
    14  
    15  	message Peer {
    16  		optional string id = 1;
    17  		optional string addr = 2;
    18  	}
    19  
    20  	// defines what type of message it is.
    21  	optional MessageType type = 1;
    22  
    23  	// defines what coral cluster level this query/response belongs to.
    24  	optional int32 clusterLevelRaw = 10;
    25  
    26  	// Used to specify the key associated with this message.
    27  	// PUT_VALUE, GET_VALUE, ADD_PROVIDER, GET_PROVIDERS
    28  	optional string key = 2;
    29  
    30  	// Used to return a value
    31  	// PUT_VALUE, GET_VALUE
    32  	optional bytes value = 3;
    33  
    34  	// Used to return peers closer to a key in a query
    35  	// GET_VALUE, GET_PROVIDERS, FIND_NODE
    36  	repeated Peer closerPeers = 8;
    37  
    38  	// Used to return Providers
    39  	// GET_VALUE, ADD_PROVIDER, GET_PROVIDERS
    40  	repeated Peer providerPeers = 9;
    41  }