barrel_rep_transport_http (barrel_docdb v1.1.1)
View SourceThe network replication transport: barrel_rep_transport over HTTP (hackney), speaking the /db/:db/_sync/* wire served by barrel_server_sync.
The endpoint term is a normalized map built by endpoint/1; the normalized URL alone feeds the replication id (rep_id_term/1), so credentials and tuning never invalidate checkpoints. Every request carries an x-barrel-hlc header and folds the response header back into the local clock (passive coupling on top of the explicit sync_hlc exchange).
Auth: auth => #{token => Bin} on the endpoint, else the app env {barrel_docdb, sync_auth, #{Origin => Token}} keyed by <<"scheme://host:port">> (no secrets in persisted task configs).
Summary
Functions
Build a normalized endpoint from a URL (or a map carrying one). Normalization matters: the URL is the replication identity, so scheme/host lowercase and no trailing slash keep checkpoints stable across config reformatting.
The replication identity of this endpoint: the normalized URL only (credentials and tuning excluded).
Types
-type endpoint() :: #{url := binary(), auth => #{token := binary()}, signing => #{key_id := binary(), priv_key := binary()}, ssl_options => [term()], pool => atom(), connect_timeout => pos_integer(), recv_timeout => pos_integer(), headers => [{binary(), binary()}]}.
Functions
Build a normalized endpoint from a URL (or a map carrying one). Normalization matters: the URL is the replication identity, so scheme/host lowercase and no trailing slash keep checkpoints stable across config reformatting.
The replication identity of this endpoint: the normalized URL only (credentials and tuning excluded).