生成 rpc

laosan123發表於2021-10-21

命令

luwei@luweideMacBook-Pro-2 transform % goctl rpc template -o transform.proto
luwei@luweideMacBook-Pro-2 transform % pwd
/Users/myself/Golang/common_project/src/shorturl/rpc/transform
luwei@luweideMacBook-Pro-2 transform % 

生成的模板如下

syntax = "proto3";

package transform;

message Request {
  string ping = 1;
}

message Response {
  string pong = 1;
}

service Transform {
  rpc Ping(Request) returns(Response);
}
本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章