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: sigv4_middleware.go
    path of file: ./repos/grafana/pkg/infra/httpclient/httpclientprovider
    
    the code of the file until where you have to start completion: package httpclientprovider

import (
	"fmt"
	"net/http"

	"github.com/grafana/grafana-aws-sdk/pkg/sigv4"
	"github.com/grafana/grafana-plugin-sdk-go/backend/httpclient"
)

// SigV4MiddlewareName the middleware name used by SigV4Middleware.
const SigV4MiddlewareName = "si
    
func SigV4Middleware(verboseLogging bool) httpclient.Middleware {
	return httpclient.NamedMiddlewareFunc(SigV4MiddlewareName, func(opts httpclient.Options, next http.RoundTripper) http.RoundTripper {
		if opts.SigV4 == nil {
			return next
		}

		conf := &sigv4.Config{
			Service:       opts.SigV4.Service,
			AccessKey:     opts.SigV4.AccessKey,
			SecretKey:     opts.SigV4.SecretKey,
			Region:        opts.SigV4.Region,
			AssumeRoleARN: opts.SigV4.AssumeRoleARN,
			AuthType:      opts.SigV4.AuthType,
			ExternalID:    opts.SigV4.ExternalID,
			Profile:       opts.SigV4.Profile,
		}

		rt, err := newSigV4Func(conf, next, sigv4.Opts{VerboseMode: verboseLogging})
		if err != nil {
			return invalidSigV4Config(err)
		}

		return rt
	})
}