httpclient

package
v0.68.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2026 License: AGPL-3.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package httpclient provides a shared resty HTTP client factory with optional OpenTelemetry tracing. Whether to instrument is decided by package otelenv, the same predicate the tracer provider in package observability uses, so a transport can never emit spans the provider is not exporting (or stay silent while it is).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() *resty.Client

New creates a resty client with the default 30s timeout and optional OTel transport instrumentation.

func NewWithTimeout

func NewWithTimeout(timeout time.Duration) *resty.Client

NewWithTimeout creates a resty client with a custom timeout and optional OTel transport instrumentation.

func StdHTTPClient

func StdHTTPClient() *http.Client

StdHTTPClient returns a standard *http.Client with the shared instrumented transport. No timeout is set because this client is used for SSE/streaming requests where the context deadline controls cancellation.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL