ExampleInterceptorsFiles returns the files for the example server and client interceptors.
(genpkg string, r *expr.RootExpr, services *ServicesData)
| 12 | |
| 13 | // ExampleInterceptorsFiles returns the files for the example server and client interceptors. |
| 14 | func ExampleInterceptorsFiles(genpkg string, r *expr.RootExpr, services *ServicesData) []*codegen.File { |
| 15 | var fw []*codegen.File |
| 16 | for _, svc := range r.Services { |
| 17 | if f := exampleInterceptorsFile(genpkg, svc, services); f != nil { |
| 18 | fw = append(fw, f...) |
| 19 | } |
| 20 | } |
| 21 | return fw |
| 22 | } |
| 23 | |
| 24 | // exampleInterceptorsFile returns the example interceptors for the given service. |
| 25 | func exampleInterceptorsFile(genpkg string, svc *expr.ServiceExpr, services *ServicesData) []*codegen.File { |