1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// Project: factbook
// File: src/lib.rs
// Purpose: Crate root
// Language: Rust
//
// License: Apache-2.0
// Copyright: (c) 2026 HYPERI PTY LIMITED
//! 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
//!
//! | feature | adds |
//! |---|---|
//! | `geoip` *(default)* | `geoip-download` + `geoip-lookup` |
//! | `geoip-download` | resolve, freshness-check, download, unpack, refresh, and [`table`] |
//! | `geoip-lookup` | resident or mapped readers, the cache, [`geoip::GeoIpRecord`] |
//! | `metrics` | emit through the `metrics` facade |
//! | `metrics-lookup` | cache 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.
// The README's examples are compiled by `cargo test`, so an API change that
// outdates them fails the build rather than misleading a reader.
// Acquisition, not geography: a table rides the download stack and needs no
// MMDB reader, so it is gated with the half of the crate that fetches.
pub use Secret;
// Both appear in this crate's public API -- a client goes in, a reader error
// comes out -- so a consumer needs the exact versions linked here rather than
// whichever its own manifest resolves.
pub use reqwest;
pub use maxminddb;
/// Crate version, for the user-agent a provider sees.
pub const VERSION: &str = env!;