1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-02-13 13:48:51 +02:00

remove streaming method (#416)

This commit is contained in:
Sam 2019-11-06 15:09:53 +08:00 committed by Tony
parent 72b47187d9
commit b867d682d9

View File

@ -293,9 +293,16 @@ func (t *Base) GoTypeName(protoName string) string {
return prefix + name
}
func streamingMethod(method *descriptor.MethodDescriptorProto) bool {
return (method.ServerStreaming != nil && *method.ServerStreaming) || (method.ClientStreaming != nil && *method.ClientStreaming)
}
func (t *Base) ShouldGenForMethod(file *descriptor.FileDescriptorProto,
service *descriptor.ServiceDescriptorProto,
method *descriptor.MethodDescriptorProto) bool {
if streamingMethod(method) {
return false
}
if !t.Params.ExplicitHTTP {
return true
}