Expand description
Shared HTTP plumbing for the pomelo-* bring-your-own-key sync crates.
Every vendor adapter (pomelo-fmp, pomelo-eodhd, pomelo-alpha-vantage,
pomelo-finnhub) needs the same primitives: a mockable HttpClient, a
Fetcher that adds rate-limit throttle + bounded exponential-backoff
retry, token redaction for logs, and a WriteMode. Those are identical
by copy across the adapters, so they live here once (conventions: citrusquant
issue #211).
No vendor logic. JSON field maps, densify formulas, symbol suffix rules,
and rating mappers stay in the vendor crate — forcing one of those here would
create false parity. (List-endpoint error envelopes are similar enough to
share: their key shapes are a common set and the label is cosmetic, so
Fetcher::get_rows handles them here rather than per vendor.)
The Fetcher reads its throttle/retry knobs through the RetrySettings
trait, which each vendor’s SyncConfig implements, so no vendor SyncConfig
type leaks in here.
Structs§
- Fetcher
- Wraps an
HttpClientwith a rate-limit throttle and retry/backoff loop.
Enums§
- Http
Error - A classified HTTP failure so the retry loop knows whether to back off.
- Write
Mode - How an already-present symbol tree is treated by a sync run.
Traits§
- Http
Client - Minimal blocking HTTP GET, abstracted so sync logic is tested with a mock.
- Retry
Settings - Throttle/retry knobs a
Fetcherneeds, supplied by each vendorSyncConfig.
Functions§
- redact
- Redact vendor token query params for stderr logs (covers
token,apikey,api_key,api_token).