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: 0

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