go-common/app/tool/warden/generator/templates/service.tmpl
2019-04-22 18:49:16 +08:00

17 lines
393 B
Cheetah

syntax = "proto3";
package {{.Package}};
{{range $key, $value := .Imports}}
import "{{$key}}";{{end}}
option go_package = "v1";
{{range .Messages}}
message {{.Name}} { {{range .Fields}}
{{.FieldType}} {{.FieldName}} = {{.FieldID}};{{end}}
}
{{end}}
service {{.Name}} { {{range .Methods}}
{{range .Comments}}// {{.}} {{end}}
rpc {{.Name}}({{.Req}}) returns({{.Reply}}); {{end}}
}