Can I define a grpc call with a null request or response?

前端 未结 3 1555
生来不讨喜
生来不讨喜 2020-12-12 21:17

Does the rpc syntax in proto3 allow null requests or responses?

e.g. I want the equivalent of the following:

rpc Logout;
rpc Status returns (Status);         


        
3条回答
  •  抹茶落季
    2020-12-12 21:56

    You also can use predefined:

    import "google/protobuf/empty.proto";
    package MyPackage;
    
    service MyService {
      rpc Check(google.protobuf.Empty) returns (google.protobuf.Empty) {}
    }
    

提交回复
热议问题