Skip to content

Add city lookup, move GeoIP into a separate module - #116

Merged
blind-oracle merged 4 commits into
mainfrom
igor/geoip-work
Sep 9, 2026
Merged

blind-oracle merged 4 commits into
mainfrom
igor/geoip-work

Conversation

@blind-oracle

@blind-oracle blind-oracle commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

City is needed for DNS GeoIP to get more precise client locations

@blind-oracle
blind-oracle requested a review from a team as a code owner September 8, 2026 12:57
@blind-oracle blind-oracle changed the title Move GeoIP into a separate module Add city lookup, move GeoIP into a separate module Sep 8, 2026
Comment thread ic-bn-lib/src/geoip.rs
impl From<geoip2::City<'_>> for City {
fn from(city: geoip2::City<'_>) -> Self {
Self {
// Try English, then German, otherwise None

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙂

@blind-oracle blind-oracle Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I guess not many here can read Russian/Japanese/Chinese 😄 We don't use the names currently anyway, only coordinates.

pub struct Names<'a> {
    pub german: Option<&'a str>,
    pub english: Option<&'a str>,
    pub spanish: Option<&'a str>,
    pub french: Option<&'a str>,
    pub japanese: Option<&'a str>,
    pub brazilian_portuguese: Option<&'a str>,
    pub russian: Option<&'a str>,
    pub simplified_chinese: Option<&'a str>,
}

@blind-oracle
blind-oracle merged commit b9cae97 into main Sep 9, 2026
6 checks passed
@blind-oracle
blind-oracle deleted the igor/geoip-work branch September 9, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants