Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@
}

// Build constructs a single Interceptor from a InterceptorRegistry
func (r *Registry) Build(id string) (Interceptor, error) {
// The extra interceptors are added to the chain before the ones specified
// by the registry.
func (r *Registry) Build(id string, extra... Interceptor) (Interceptor, error) {

Check warning on line 19 in registry.go

View check run for this annotation

Codecov / codecov/patch

registry.go#L19

Added line #L19 was not covered by tests
if len(r.factories) == 0 {
return &NoOp{}, nil
}

interceptors := []Interceptor{}

interceptors = append(interceptors, extra...)

Check warning on line 27 in registry.go

View check run for this annotation

Codecov / codecov/patch

registry.go#L25-L27

Added lines #L25 - L27 were not covered by tests
for _, f := range r.factories {
i, err := f.NewInterceptor(id)
if err != nil {
Expand Down
Loading