message.proto 882 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
syntax = "proto3";

package graphsync.message.pb;

import "github.com/gogo/protobuf/gogoproto/gogo.proto";

message Message {

  message Request {
    int32 id = 1;       // unique id set on the requester side
    bytes root = 2;     // ipld root node for selector
    bytes selector = 3; // ipld selector to retrieve
    bytes extra = 4;    // aux information. useful for other protocols
    int32 priority = 5;	// the priority (normalized). default to 1
hannahhoward's avatar
hannahhoward committed
15
    bool  cancel = 6;   // whether this cancels a request
16 17 18 19 20 21 22 23 24 25 26 27 28
  }

  message Response {
    int32 id = 1;     // the request id
    int32 status = 2; // a status code.
    bytes data = 3; // core response data
    bytes extra = 4; // additional data
  }

  // the actual data included in this message
  repeated Request reqlist = 1 [(gogoproto.nullable) = false];
  repeated Response reslist = 2 [(gogoproto.nullable) = false];
}