syntax = "proto3";
package aiges;
option go_package = "./proto";

service WrapperService {
  rpc wrapperInit(InitRequest) returns (Ret) {}
  rpc wrapperOnceExec(Request) returns (Response) {}
  rpc wrapperSchema(SvcId) returns (Schema) {}
  rpc testStream(stream StreamRequest) returns (stream Response) {}
  //
  // Accepts a stream of RouteNotes sent while a route is being traversed,
  // while receiving other RouteNotes (e.g. from other users).
  rpc communicate(stream Request) returns (stream Response) {}

}

message  Ret {
  int32 ret = 1;
}

message SvcId {
  string serviceId = 1;
}

message Schema {
  string data = 1;
}


message RequestData {
  string key = 1;
  uint64 len = 2;
  uint32 type = 3;
  uint32 status = 4;
  map<string, string> desc = 5;
  bytes data = 6;

}

message ResponseData {
  string key = 1;
  uint64 len = 2;
  uint32 type = 3;
  uint32 status = 4;
  map<string, string> desc = 5;
  bytes data = 6;
}

message Response {
  string tag = 1;
  int32 ret = 2 ;
  repeated ResponseData list = 3;

}
message InitRequest {
  map<string, string> config = 1;
}

message Request {
  string    tag = 1;
  map<string, string> params = 2;
  repeated RequestData list = 3;
}

message StreamRequest {
  string data = 1;
}