httpx

package
v0.0.0-...-1096d29 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package httpx provides the shared HTTP client used by every operation command. It injects auth, identity, an idempotency key on mutations, and retries on transient failures (429 and 5xx).

Index

Constants

View Source
const (
	DefaultTimeout    = 60 * time.Second
	DefaultMaxRetries = 3
)

Defaults for the shared client. The CLI exposes flags to override them per invocation.

Variables

View Source
var Version = "dev"

Version is overwritten at build time by the release pipeline.

Functions

func New

func New(apiKey string) *http.Client

New returns an *http.Client wired with auth + identity headers, idempotency keys on non-idempotent methods, and retry-on-transient-failure semantics.

func NewWithOptions

func NewWithOptions(opt Options) *http.Client

NewWithOptions builds a client for callers that need to tune retries or timeout. Intended for tests that want a tighter loop.

Types

type Options

type Options struct {
	APIKey     string
	Timeout    time.Duration
	MaxRetries int
}

Options controls the shared client behaviour. Zero values pick sensible defaults so callers can pass `Options{APIKey: k}` and ignore the rest.

Jump to

Keyboard shortcuts

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