You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
goctls-template/rpc/template.tpl

59 lines
945 B
Smarty

syntax = "proto3";
package {{.package}};
option go_package="./{{.package}}";
// Base message
message Empty {}
message IDReq {
int64 id = 1;
}
message IDsReq {
repeated int64 ids = 1;
}
// 基础回执
message BaseResp {
uint32 code = 1;
string msg = 2;
}
// 基础回执带ID
message BaseIDResp {
int64 id = 1;
uint32 code = 2;
string msg = 3;
}
// 分页参数
message Pagination {
uint64 size = 1; //
uint64 total = 2; //
uint64 current = 3; //
}
// 操作类型
enum Operator {
EQ = 0; // ==
NEQ = 1; // !=
IN = 2; // in ()
NotIn = 3; // not in ()
GT = 4; // >
GTE = 5; // >=
LT = 6; // <
LTE = 7; // <=
Contains = 8; // %{}%
Prefix = 9; // {}%
Suffix = 10; // %{}
EqualFold = 11; // == with toLower
ContainsFold = 12; // %{}% with toLower
}
service {{.serviceName}} {
// group: base
rpc initDatabase (Empty) returns (BaseResp);
}