syntax = "proto3"; import "google/protobuf/empty.proto"; option go_package = "./postal"; service Postal { rpc Deliver(ReqDeliver) returns (ResDeliver); rpc DeliverBatch(ReqDeliverBatch) returns(ResDeliver); rpc DeliverGroup(ReqDeliverGroup) returns(ResDeliver); rpc GroupCreate(ReqGroupCreate) returns(ResGroupCreate); rpc GroupJoin(ReqGroupJoin) returns(google.protobuf.Empty); rpc GroupLeave(ReqGroupLeave) returns(google.protobuf.Empty); rpc GroupDissolve(ReqGroupDissolve) returns(google.protobuf.Empty); } message Message { int64 time = 3; int32 svcNo = 4; int32 msgNo = 5; bytes body = 6; // 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; } message ReqDeliverGroup { string gid = 1; Message msg = 2; } message ReqGroupCreate { string gid = 1; // 群id map tags = 3; // 群标签... bool persistent = 7; // 群关系是否持久化, 默认否 } message ResGroupCreate { string gid = 1; // 群id } message ReqGroupJoin { string gid = 1; string uid = 2; } message ReqGroupLeave { string gid = 1; string uid = 2; } message ReqGroupDissolve { string gid = 1; }