fixup generated file names and grpc template

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-01-16 03:56:35 +03:00
parent 30994d5c62
commit 60d65b507d
4 changed files with 14 additions and 45 deletions

File diff suppressed because one or more lines are too long

View File

@ -59,23 +59,8 @@ func (c *{{$ServiceName | lowerFirst}}Service) {{.Name}}(ctx context.Context, re
return rsp, nil return rsp, nil
{{- end}} {{- end}}
} }
{{if or (.ServerStreaming) (.ClientStreaming)}}
type {{$ServiceName}}_{{.Name}}Service interface {
Context() context.Context
SendMsg(interface{}) error
RecvMsg(interface{}) error
{{- if and (.ClientStreaming) (not .ServerStreaming)}}
RecvAndClose() (*{{$rspMethod}}, error)
{{- end}}
Close() error
{{- if .ClientStreaming}}
Send(*{{$reqMethod}}) error
{{- end}}
{{- if .ServerStreaming}}
Recv() (*{{$rspMethod}}, error)
{{- end}}
}
{{if or (.ServerStreaming) (.ClientStreaming)}}
type {{$ServiceName | lowerFirst}}Service{{.Name}} struct { type {{$ServiceName | lowerFirst}}Service{{.Name}} struct {
stream micro_client.Stream stream micro_client.Stream
} }
@ -156,22 +141,6 @@ func (h *{{$ServiceName | lowerFirst}}Handler) {{.Name}}(ctx context.Context, re
} }
{{- end}} {{- end}}
{{if or (.ServerStreaming) (.ClientStreaming)}} {{if or (.ServerStreaming) (.ClientStreaming)}}
type {{$ServiceName}}_{{.Name}}Stream interface {
Context() context.Context
SendMsg(interface{}) error
RecvMsg(interface{}) error
{{- if and (.ClientStreaming) (not .ServerStreaming)}}
SendAndClose(*{{$rspMethod}}) error
{{- end}}
Close() error
{{- if .ServerStreaming}}
Send(*{{$rspMethod}}) error
{{- end}}
{{- if .ClientStreaming}}
Recv() (*{{$reqMethod}}, error)
{{- end}}
}
type {{$ServiceName | lowerFirst}}{{.Name}}Stream struct { type {{$ServiceName | lowerFirst}}{{.Name}}Stream struct {
stream micro_server.Stream stream micro_server.Stream
} }