chrly/internal/di/httpClient.go
2024-02-20 02:08:23 +01:00

19 lines
317 B
Go

package di
import (
"net/http"
"github.com/defval/di"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
)
var httpClientDiOptions = di.Options(
di.Provide(newHttpClient),
)
func newHttpClient() *http.Client {
return &http.Client{
Transport: otelhttp.NewTransport(http.DefaultTransport),
}
}