rename shared package to common

This commit is contained in:
Jesse de Wit
2023-10-26 14:39:03 +02:00
parent fb3b051d02
commit 3cf4b714a9
22 changed files with 251 additions and 251 deletions

View File

@@ -0,0 +1,27 @@
package common
import "log"
type CombinedHandler struct {
handlers []InterceptHandler
}
func NewCombinedHandler(handlers ...InterceptHandler) *CombinedHandler {
return &CombinedHandler{
handlers: handlers,
}
}
func (c *CombinedHandler) Intercept(req InterceptRequest) InterceptResult {
for i, handler := range c.handlers {
res := handler.Intercept(req)
log.Printf("Intercept %+v. Interceptor %d returns %+v", req, i, res)
if res.Action != INTERCEPT_RESUME {
return res
}
}
return InterceptResult{
Action: INTERCEPT_RESUME,
}
}