Update GeoLite database (#583)

* Update GeoLite database

* fmt and fix test

---------

Co-authored-by: Milos Kriz <milos_kriz@hotmail.com>
Co-authored-by: Milos Kriz <82968568+miloskriz@users.noreply.github.com>
This commit is contained in:
James Wilson
2024-04-12 11:09:06 +01:00
committed by GitHub
parent f132b8e90e
commit 7bf2925a23
2 changed files with 8 additions and 6 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 MiB

After

Width:  |  Height:  |  Size: 55 MiB

+8 -6
View File
@@ -81,13 +81,15 @@ struct Locator {
}
impl Locator {
/// GeoLite database release data: 2023-10-13
///
/// GeoLite database release data: 2024-03-29
/// Database and Contents Copyright (c) 2024 MaxMind, Inc.
/// To download the latest version visit: https://dev.maxmind.com/geoip/geolite2-free-geolocation-data.
///
/// This database incorporates GeoNames [https://www.geonames.org] geographical data, which is made available
/// under the Creative Commons Attribution 4.0 License.
/// To view a copy of this license,visit https://creativecommons.org/licenses/by/4.0/.
/// Use of this MaxMind product is governed by MaxMind's GeoLite2 End User License Agreement,
/// which can be viewed at https://www.maxmind.com/en/geolite2/eula.
/// This database incorporates GeoNames [https://www.geonames.org] geographical data,
/// which is made available under the Creative Commons Attribution 4.0 License.
/// To view a copy of this license, visit https://creativecommons.org/licenses/by/4.0/.
const CITY_DATA: &'static [u8] = include_bytes!("GeoLite2-City.mmdb");
pub fn new(cache: FxHashMap<IpAddr, Arc<NodeLocation>>) -> Self {
@@ -144,6 +146,6 @@ mod tests {
fn locate_random_ip() {
let ip = "12.5.56.25".parse().unwrap();
let node_location = Locator::new(Default::default()).locate(ip).unwrap();
assert_eq!(&*node_location.city, "Riverside");
assert_eq!(&*node_location.city, "Gardena");
}
}