Skip to content

Commit

Permalink
geoip2 coments
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanDeveloper committed Feb 27, 2024
1 parent 04a42b5 commit 35c8135
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions heidpi-rust/src/geoip.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
use std::net::IpAddr;
use anyhow::Ok;
use maxminddb::Reader;

/// .
// TODO create geoip2 object, be aware multiple threads will read this object, check Tokio how to do it! (Mutex...)
struct GeoIP {

}


impl GeoIP {
pub fn new()-> anyhow::Result<()> {
Ok(())
}
pub fn get_geoip(ip: &IpAddr) -> anyhow::Result<()> {
let reader = maxminddb::Reader::open_readfile("test-data/test-data/GeoIP2-City-Test.mmdb").unwrap();
Ok(())
Expand Down

0 comments on commit 35c8135

Please sign in to comment.