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 1a82ea1Copy full SHA for 1a82ea1
registry.go
@@ -14,7 +14,9 @@ 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 after 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
@@ -29,5 +31,7 @@ func (r *Registry) Build(id string) (Interceptor, error) {
29
31
interceptors = append(interceptors, i)
30
32
33
34
+ interceptors = append(interceptors, extra...)
35
+
36
return NewChain(interceptors), nil
37
0 commit comments