nali 0.1.2

A command-line tool that enriches IP addresses with GeoIP information, enhancing network diagnostics with geographical context.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
#[derive(Debug, Clone, PartialEq)]
pub struct GeoLocation {
    pub location: String,
}
pub trait GeoDB {
    fn lookup(&self, ip: &str) -> Option<GeoLocation>;
}

impl GeoDB for Box<dyn GeoDB> {
    fn lookup(&self, ip: &str) -> Option<GeoLocation> {
        (**self).lookup(ip)
    }
}