|
|
|
@ -5,6 +5,7 @@ import ( |
|
|
|
|
"html/template" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
//nolint:lll
|
|
|
|
|
var serviceTemplate = ` |
|
|
|
|
{{- /* delete empty line */ -}} |
|
|
|
|
package service |
|
|
|
@ -34,8 +35,7 @@ func New{{ .Service }}Service() *{{ .Service }}Service { |
|
|
|
|
{{- $s1 := "google.protobuf.Empty" }} |
|
|
|
|
{{ range .Methods }} |
|
|
|
|
{{- if eq .Type 1 }} |
|
|
|
|
func (s *{{ .Service }}Service) {{ .Name }}(ctx context.Context, req {{ if eq .Request $s1 }}*emptypb.Empty |
|
|
|
|
{{ else }}*pb.{{ .Request }}{{ end }}) ({{ if eq .Reply $s1 }}*emptypb.Empty{{ else }}*pb.{{ .Reply }}{{ end }}, error) { |
|
|
|
|
func (s *{{ .Service }}Service) {{ .Name }}(ctx context.Context, req {{ if eq .Request $s1 }}*emptypb.Empty{{ else }}*pb.{{ .Request }}{{ end }}) ({{ if eq .Reply $s1 }}*emptypb.Empty{{ else }}*pb.{{ .Reply }}{{ end }}, error) { |
|
|
|
|
return {{ if eq .Reply $s1 }}&emptypb.Empty{}{{ else }}&pb.{{ .Reply }}{}{{ end }}, nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|