Aurinko.HTTP.Client (Aurinko v0.2.1)

Copy Markdown View Source

Production HTTP client for the Aurinko API.

Middleware stack applied on every request:

  1. Rate limiting — Token-bucket per-account + global RPS (Aurinko.RateLimiter)
  2. Circuit breaker — Per-path circuit breaker prevents cascading failures (Aurinko.CircuitBreaker)
  3. Caching — ETS TTL cache for safe GET responses (Aurinko.Cache)
  4. Retry — Exponential backoff + jitter for 429 / 5xx
  5. Telemetry — Structured events for every request/response/retry
  6. Structured errors — All failures surface as {:error, %Aurinko.Error{}}

Summary

Types

method()

@type method() :: :get | :post | :patch | :put | :delete

result()

@type result() :: {:ok, map() | list() | binary()} | {:error, Aurinko.Error.t()}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

delete(token, path, opts \\ [])

get(token, path, opts \\ [])

patch(token, path, body, opts \\ [])

post(token, path, body \\ nil, opts \\ [])

put(token, path, body, opts \\ [])

start_link(opts \\ [])