mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
Don't set stream unless its true
This commit is contained in:
parent
0b1e6d7eaf
commit
a9e8fc6039
@ -95,14 +95,20 @@ func extractEndpoint(method reflect.Method) *registry.Endpoint {
|
||||
request := extractValue(reqType, 0)
|
||||
response := extractValue(rspType, 0)
|
||||
|
||||
return ®istry.Endpoint{
|
||||
ep := ®istry.Endpoint{
|
||||
Name: method.Name,
|
||||
Request: request,
|
||||
Response: response,
|
||||
Metadata: map[string]string{
|
||||
"stream": fmt.Sprintf("%v", stream),
|
||||
},
|
||||
}
|
||||
|
||||
// set endpoint metadata for stream
|
||||
if stream {
|
||||
ep.Metadata = map[string]string{
|
||||
"stream": fmt.Sprintf("%v", stream),
|
||||
}
|
||||
}
|
||||
|
||||
return ep
|
||||
}
|
||||
|
||||
func extractSubValue(typ reflect.Type) *registry.Value {
|
||||
|
@ -90,14 +90,19 @@ func extractEndpoint(method reflect.Method) *registry.Endpoint {
|
||||
request := extractValue(reqType, 0)
|
||||
response := extractValue(rspType, 0)
|
||||
|
||||
return ®istry.Endpoint{
|
||||
ep := ®istry.Endpoint{
|
||||
Name: method.Name,
|
||||
Request: request,
|
||||
Response: response,
|
||||
Metadata: map[string]string{
|
||||
"stream": fmt.Sprintf("%v", stream),
|
||||
},
|
||||
}
|
||||
|
||||
if stream {
|
||||
ep.Metadata = map[string]string{
|
||||
"stream": fmt.Sprintf("%v", stream),
|
||||
}
|
||||
}
|
||||
|
||||
return ep
|
||||
}
|
||||
|
||||
func extractSubValue(typ reflect.Type) *registry.Value {
|
||||
|
Loading…
Reference in New Issue
Block a user