go-common/app/tool/warden/generator/templates/service.tmpl

17 lines
393 B
Cheetah
Raw Normal View History

2019-04-22 10:49:16 +00:00
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}}
}