httpclient

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package httpclient provides a shared resty HTTP client factory with optional OpenTelemetry tracing. OTel transport instrumentation activates only when OTEL_EXPORTER_OTLP_ENDPOINT is set, aligned with the trace hook in plugins/hooks/trace/.

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 OTel transport instrumentation. No timeout is set because this client is used for SSE/streaming requests where the context deadline controls cancellation. otelhttp resolves the TracerProvider from the request context at call time (not construction time), so it works regardless of init order.

Types

This section is empty.

Jump to

Keyboard shortcuts

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