How can I use common interceptor in multiple services ? #3704
Answered
by
raphael
mob-harness
asked this question in
Q&A
-
I have a common interceptor and multiple services defined. ServerInterceptors code and Info type is being generated in individual service package ? |
Beta Was this translation helpful? Give feedback.
Answered by
raphael
May 3, 2025
Replies: 1 comment
-
With the current implementation each service needs to define its own interceptors. They can share business logic e.g. via a commonly imported Go package but the types have to be instantiated in each service. We could consider an improvement where API level interceptors get generated in a special folder which would live directly under |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mob-harness
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With the current implementation each service needs to define its own interceptors. They can share business logic e.g. via a commonly imported Go package but the types have to be instantiated in each service. We could consider an improvement where API level interceptors get generated in a special folder which would live directly under
gen
.