Kozai::Catalog::Store
A collection of satellites, loaded from files and optionally refreshed from the network.
The offline contract
This is a daemon for a station that may have no internet at all, so the rules are:
- A source that fails never removes what is already loaded.
- A cached copy that is past its expiry is still used if the download fails. Stale elements degrade gracefully and their age is reported; no elements is a broken service.
- Nothing is fetched unless the cache has actually expired.
NOTE: the default expiry is 24 hours and should not be shortened. Element sets are regenerated once or twice a day, so polling faster gains nothing, and CelesTrak explicitly asks clients to cache rather than poll. Being a good citizen of someone else's bandwidth is part of shipping this.
Constructors
Instance methods
Whether what is loaded came from Bundled rather than from a
configured source. Reported through the API so that the interface can
say so: elements nobody asked for should never be mistaken for
elements somebody configured.
The satellite with this catalog number, or nil.
Age of the newest element set, or nil if nothing is loaded.
Reloads every source.
force re-downloads remote sources even if their cache is still fresh; it is what the API's manual refresh endpoint uses.
Never raises for a source that fails: the failure is recorded in
#sources and whatever else loaded is kept.
Loads element sets directly, bypassing files and the network.
Used by the tests, and by anything embedding this library that already has elements in hand.
Satellites whose name contains fragment, case-insensitively.
Age of the oldest element set, or nil if nothing is loaded.