Skip to content

add Geoopen as dbtype #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

add Geoopen as dbtype #136

wants to merge 2 commits into from

Conversation

elfranne
Copy link

@oschwald
Copy link
Owner

The ASN data is structured differently than MaxMind databases and will not work. Although the country iso_code value should work, you would be better off using maxminddb/v2:

db, err := maxminddb.Open("latest.mmdb")
if err != nil {
	return err
}

var countryCode string
err = db.Lookup(ip).DecodePath(&countryCode, "country", "iso_code")
if err != nil {
	return err
}

@elfranne
Copy link
Author

Can we just add the Country one ?

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