We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82bca40 commit 7ae31d0Copy full SHA for 7ae31d0
registry.go
@@ -14,12 +14,17 @@ func (r *Registry) Add(f Factory) {
14
}
15
16
// Build constructs a single Interceptor from a InterceptorRegistry
17
-func (r *Registry) Build(id string) (Interceptor, error) {
+// The extra interceptors are added to the chain before the ones specified
18
+// by the registry.
19
+func (r *Registry) Build(id string, extra... Interceptor) (Interceptor, error) {
20
if len(r.factories) == 0 {
21
return &NoOp{}, nil
22
23
24
interceptors := []Interceptor{}
25
+
26
+ interceptors = append(interceptors, extra...)
27
28
for _, f := range r.factories {
29
i, err := f.NewInterceptor(id)
30
if err != nil {
0 commit comments