Thin HTTP client around Erlang's :httpc with:
- per-request timeout
- optional gzip request bodies (only when the body is large enough to benefit)
- exponential backoff retry (1s, 2s, 4s …) for 5xx / 429 / network errors
- unwrapping of the
{success, data, meta}envelope when present
Mirrors the Node SDK transport.ts. A :sleep_fn may be injected (tests) to
avoid real backoff delays.
Summary
Functions
Build a resolved transport config map from options.
Perform a POST request with retry/backoff. Returns {:ok, parsed} (envelope
unwrapped) or {:error, %BilldogEng.Error{}}.
Types
@type config() :: %{ host: String.t(), request_timeout: non_neg_integer(), gzip: boolean(), max_retries: non_neg_integer(), enable_logging: boolean(), sleep_fn: (non_neg_integer() -> any()) }
Functions
Build a resolved transport config map from options.
@spec request( config(), keyword() ) :: {:ok, term()} | {:error, BilldogEng.Error.t()}
Perform a POST request with retry/backoff. Returns {:ok, parsed} (envelope
unwrapped) or {:error, %BilldogEng.Error{}}.
Options:
:path— required, path appended to host (e.g."/ingest-events"):body— the request body (will be JSON-encoded), ornilfor a GET:headers— extra headers (list of{name, value}string tuples):gzip— per-call override; defaults totrue(honored only if config gzip)