Skip to main content

Crate factbook

Crate factbook 

Source
Expand description

IP enrichment end to end: provision the GeoIP databases, keep them fresh, and look addresses up through a cache sized for skewed traffic.

Reader crates leave provisioning to the caller, so every service grows its own downloader and its own idea of where the file lives. The enrichment tables in the log-shipping tools do the reading but hold no cache, so a hot address costs a full database traversal every time it appears. This crate is both halves.

Acquisition turns out not to be a geo concern at all, so table opens the same fetch-verify-replace path to any CSV or JSON a deployment names in its own config, indexed by an address, by a CIDR range, or by any column it has.

§Features

featureadds
geoip (default)geoip-download + geoip-lookup
geoip-downloadresolve, freshness-check, download, unpack, refresh, and table
geoip-lookupresident or mapped readers, the cache, geoip::GeoIpRecord
metricsemit through the metrics facade
metrics-lookupcache hit, miss, size and lookup duration

§Databases are not bundled

Nothing here ships a database. Files are fetched at runtime from the provider you configure, and each publisher sets its own terms for its own data. geoip::source_terms reports where a given selection’s terms are published, so they can be read at the source.

Re-exports§

pub use secret::Secret;
pub use reqwest;geoip-download
pub use maxminddb;geoip-lookup

Modules§

geoipgeoip-download or geoip-lookup
GeoIP databases: which ones a service wants, getting them onto disk, and looking addresses up in them.
secret
A credential that survives being formatted into a log line.
tablegeoip-download
A table fetched from wherever the operator names, keyed by whatever reaches its rows.

Constants§

VERSION
Crate version, for the user-agent a provider sees.