hasEndpointStruct returns a function that returns true if the method has an endpoint struct if server is true, otherwise it returns false.
(server bool)
| 229 | // hasEndpointStruct returns a function that returns true if the method has an endpoint struct |
| 230 | // if server is true, otherwise it returns false. |
| 231 | func hasEndpointStruct(server bool) func(*MethodInterceptorData) bool { |
| 232 | if !server { |
| 233 | return func(*MethodInterceptorData) bool { return false } |
| 234 | } |
| 235 | return func(m *MethodInterceptorData) bool { |
| 236 | return m.ServerStream != nil && m.ServerStream.EndpointStruct != "" |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | // collectWrappedStreams returns a slice of streams to be wrapped by interceptor wrapper functions. |
| 241 | func collectWrappedStreams(interceptors []*InterceptorData, server bool) []*StreamInterceptorData { |