12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- syntax = "proto3";
- package main;
- option go_package = ".;a2s";
- service Caller {
- //远程调用
- rpc Call (Request) returns (Response) {}
- //状态查看
- rpc ViewState(StateReq)returns(StateResp){}
- }
- //请求
- message Request {
- string topic = 1;//主题
- int64 timeout = 2;//超时设定
- bytes data =3;//数据序列化
- }
- //回应
- message Response {
- int32 code =1;//返回码
- string msg = 2;//
- bytes data =3;//结构数据
- }
- //空消息体
- message StateReq{
- string topic =1;
- }
- //状态消息体
- message StateResp{
- int32 currentRequest =1 ; //当前处理的请求数
- }
- //发送给nats的消息体
- message NatsRequest{
- string msgId =1;
- int64 timestamp = 2;
- int64 timeout =3;
- bytes data=4;
- }
- //回应给nats的消息体
- message NatsResponse{
- string msgId =1;
- bytes data=4;
- }
|