syntax = "proto3"; option go_package = "./pb"; // 通过网关向客户端投递消息 service GatewayPostal { // 使用流连续发送数据 rpc DeliverStream(stream ReqDeliver) returns (ResDeliver); // 发送一次数据 rpc Deliver(ReqDeliver) returns (ResDeliver); // 批量发送数据 rpc DeliverBatch(ReqDeliverBatch) returns (ResDeliver); } message Message { int64 time = 3; string target = 4; // 消息处理 handler bytes body = 15; // protobuf bytes } message ReqDeliver { string receiver = 1; Message msg = 2; bool sync = 7; // 是否同步阻塞等待投递结果, 默认false立即返回放到队列消费投递 } message ResDeliver { bool ok = 1; int32 code = 2; string msg = 3; } message ReqDeliverBatch { repeated string receivers = 1; Message msg = 2; bool sync = 7; }