syntax = "proto3";

service AgentService {
 rpc Ping (PingRequest) returns (PongResponse){}
 rpc HeartBeat (HeartBeatRequest) returns (CurrencyResponse){}
 rpc Task (GetTaskRequest) returns (stream GetTaskResponse){}
 rpc TaskResult (TaskResultRequest) returns (CurrencyResponse){}
}
 
message PingRequest {
  string msg = 1;
}
 
message PongResponse {
  string msg = 1;
}

message HeartBeatRequest {
  string msg = 1;
  map<string, string> base_info = 2;
}

message GetTaskRequest {
  string msg = 1;
  string msg_type = 2;
  string worker_name = 3;
  map<string, string> get_task_info = 4;
}

message GetTaskResponse {
  string msg = 1;
  int64 code = 2;
  string msg_type = 3;
  string task_id = 4;
  map<string, string> task_info = 5;
}

message TaskResultRequest {
  string msg = 1;
  string msg_type = 2;
  string task_id = 3;
  map<string, string> task_result = 4;
}

message CurrencyResponse {
  string msg = 1;
  int64 code = 2;
}