Skip to main content

Module bootstrap

Module bootstrap 

Source
Expand description

Functions to download or load directory objects, using the state machines in the states module.

MacrosΒ§

propagate_fatal_errors πŸ”’
Given a Result<()>, exit the current function if it is anything other than Ok(), or a nonfatal error.

StructsΒ§

AttemptId πŸ”’
Identifier for an attempt to bootstrap a directory.

FunctionsΒ§

advance πŸ”’
Replace state with state.advance().
download πŸ”’
Download information into a DirState state machine until it is β€œcomplete”, or until we hit a non-recoverable error.
download_attempt πŸ”’
Helper: Make a set of download attempts for the current directory state, and on success feed their results into the state object.
fetch_multiple πŸ”’
Launch a set of download requests for a set of missing objects in missing, and return each request along with the response it received.
fetch_single πŸ”’
Launch a single client request and get an associated response.
load πŸ”’
Try to load as much state as possible for a provided state from the cache in dirmgr, advancing the state to the extent possible.
load_and_apply_documents πŸ”’
Load every document in missing and try to apply it to state.
load_documents_from_store πŸ”’
Load a set of documents from a Store, returning all documents found in the store. Note that this may be less than the number of documents in missing.
load_once πŸ”’
Try to update state by loading cached information from dirmgr.
make_consensus_request πŸ”’
Construct an appropriate ClientRequest to download a consensus of the given flavor.
make_requests_for_documents πŸ”’
Construct a set of ClientRequests in order to fetch the documents in docs.
no_more_than_a_week_from πŸ”’
Helper: Clamp v so that it is no more than one week from now.
note_cache_error πŸ”’
Record that a problem has occurred because of a failure in an answer from source.
note_cache_success πŸ”’
Record that source has successfully given us some directory info.
note_request_outcome πŸ”’
If there were errors from a peer in outcome, record those errors by marking the circuit (if any) as needing retirement, and noting the peer (if any) as having failed.
reset πŸ”’
Replace state with state.reset().