Documentation
¶
Overview ¶
Package httpx is the shared HTTP core for provider backends: a client with bounded retries + backoff on transient failures, Retry-After handling, and defensive JSON helpers so an upstream field rename surfaces as SCHEMA_DRIFT, not a panic. Providers classify status codes into domain errors (internal/errs); this layer is transport-only.
Index ¶
- func Arr(m map[string]any, path string) []any
- func AsObj(v any) map[string]any
- func Bool(m map[string]any, path string) bool
- func Decode(b []byte) (map[string]any, error)
- func Float(m map[string]any, path string) float64
- func Has(m map[string]any, path string) bool
- func Int(m map[string]any, path string) int
- func Str(m map[string]any, path string) string
- func StrOf(v any, key string) string
- type Client
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Float ¶
Float returns the number at path, coercing numeric strings (e.g. "$12.99" is NOT coerced; pass already-numeric fields). Returns 0 if absent.
Types ¶
type Client ¶
type Client struct {
HTTP *http.Client
UserAgent string
MaxRetries int // retries AFTER the first attempt
BaseDelay time.Duration // backoff base
}
Client is a thin retrying HTTP client. Zero value is not usable — call New.
Click to show internal directories.
Click to hide internal directories.