You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: inflight_req.go
    path of file: ./repos/traefik/pkg/middlewares/inflightreq
    
    the code of the file until where you have to start completion: package inflightreq

import (
	"context"
	"fmt"
	"net/http"

	"github.com/rs/zerolog"
	"github.com/traefik/traefik/v3/pkg/config/dynamic"
	"github.com/traefik/traefik/v3/pkg/logs"
	"github.com/traefik/traefik/v3
    
func New(ctx context.Context, next http.Handler, config dynamic.InFlightReq, name string) (http.Handler, error) {
	logger := middlewares.GetLogger(ctx, name, typeName)
	logger.Debug().Msg("Creating middleware")

	ctxLog := logger.WithContext(ctx)

	if config.SourceCriterion == nil ||
		config.SourceCriterion.IPStrategy == nil &&
			config.SourceCriterion.RequestHeaderName == "" && !config.SourceCriterion.RequestHost {
		config.SourceCriterion = &dynamic.SourceCriterion{
			RequestHost: true,
		}
	}

	sourceMatcher, err := middlewares.GetSourceExtractor(ctxLog, config.SourceCriterion)
	if err != nil {
		return nil, fmt.Errorf("error creating requests limiter: %w", err)
	}

	handler, err := connlimit.New(next, sourceMatcher, config.Amount,
		connlimit.Logger(logs.NewOxyWrapper(*logger)),
		connlimit.Verbose(logger.GetLevel() == zerolog.TraceLevel))
	if err != nil {
		return nil, fmt.Errorf("error creating connection limit: %w", err)
	}

	return &inFlightReq{handler: handler, name: name}, nil
}