Expand description
The HTTP seam.
Every request the GitHub and GitLab clients make goes through
HttpTransport; nothing in this crate constructs a socket itself,
so the whole crate is testable without a network. The clients’ tests
drive RecordedTransport; only ReqwestTransport talks to a host.
Structs§
- Http
Bytes - A binary answer (
HttpTransport::fetch_bytes): the status is left to the caller, because for a picture a 404 is an answer, not a failure. - Http
Request - Http
Response - Recorded
Transport - A transport that answers from a table instead of from the network.
- Reqwest
Transport - The real transport. Built once per client, not per request:
reqwest::Clientowns the connection pool.
Enums§
Constants§
- BLOCK_
EXTERNAL_ ENV - Env var that makes the real transports refuse non-loopback hosts. Set by
the PTY driver (
xtask) for the TUI and the daemon it starts; always on in this crate’s own unit tests. - LIVE_
TESTS_ ENV - The master switch of live provider tests (
gitpoulpi_testkit::live).
Traits§
Functions§
- external_
host_ refusal Some(reason)when a test build must not sendurl: the host is not loopback, blocking is on (cfg(test)orBLOCK_EXTERNAL_ENV) andGITPOULPI_LIVE_TESTS=1is not set. A leaked real call fails loudly instead of connecting. Production builds (neither set) never refuse.
Type Aliases§
- Progress
- A download’s progress callback: bytes received so far and the total when
the host said it;
falsestops the download.