This is a utility for efficiently using the iptoasn.com GeoIP data in Go programs, by converting the raw .tsv data to the mmdb format (MaxMind DB File Format). It uses the maxmind/mmdbwriter library for the mmdb conversion.
Usage
Installation - go install github.com/case/iptoasn-go/cmd/iptoasn@v1.0.0
Usage - iptoasn --download -o iptoasn.mmdb - downloads and converts the default ip2asn-combined.tsv.gz file
Use the resulting .mmdb file in your Go programs, via the oschwald/geoip2-golang library
Misc
Minimum Go version supported - 1.24 (as required by maxmind/mmdbwriter)
IPtoASN supported files:
ip2asn-combined.tsv.gz
ip2asn-v4.tsv.gz
ip2asn-v6.tsv.gz
ip2country-v4.tsv.gz
ip2country-v6.tsv.gz
Thank you 🙏
Frank Denis, for providing the iptoasn.com data service
MaxMind, for the mmdb file format, and the read & write Go code