validateInterceptors validates the method interceptors.
()
| 272 | |
| 273 | // validateInterceptors validates the method interceptors. |
| 274 | func (m *MethodExpr) validateInterceptors() *eval.ValidationErrors { |
| 275 | verr := new(eval.ValidationErrors) |
| 276 | m.ClientInterceptors = mergeInterceptors(m.ClientInterceptors, m.Service.ClientInterceptors, Root.API.ClientInterceptors) |
| 277 | for _, i := range m.ClientInterceptors { |
| 278 | verr.Merge(i.validate(m)) |
| 279 | } |
| 280 | m.ServerInterceptors = mergeInterceptors(m.ServerInterceptors, m.Service.ServerInterceptors, Root.API.ServerInterceptors) |
| 281 | for _, i := range m.ServerInterceptors { |
| 282 | verr.Merge(i.validate(m)) |
| 283 | } |
| 284 | return verr |
| 285 | } |
| 286 | |
| 287 | // mergeInterceptors merges interceptors from different levels (method, service, API) |
| 288 | // while avoiding duplicates. The order of precedence is: method > service > API. |
no test coverage detected