All Projects → IncSW → geoip2

IncSW / geoip2

Licence: MIT license
GeoIP2 Reader for Go

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to geoip2

mmdbwriter
Go library for writing MaxMind DB (mmdb) files
Stars: ✭ 44 (-18.52%)
Mutual labels:  geoip2, geoip, maxmind
geoip2-rs
Fast GeoIP2 Reader for Rust
Stars: ✭ 25 (-53.7%)
Mutual labels:  geoip2, geoip, maxmind
MaxMind-DB-Writer-perl
Create MaxMind DB database files
Stars: ✭ 63 (+16.67%)
Mutual labels:  geoip2, geoip, maxmind
GeoIP2-perl
Perl API for MaxMind's GeoIP2 web services and databases
Stars: ✭ 18 (-66.67%)
Mutual labels:  geoip2, geoip, maxmind
Geoip2 Php
PHP API for GeoIP2 webservice client and database reader
Stars: ✭ 1,956 (+3522.22%)
Mutual labels:  geoip2, geoip, maxmind
MaxMind-DB-Reader-java
Java reader for the MaxMind DB format
Stars: ✭ 88 (+62.96%)
Mutual labels:  geoip2, geoip, maxmind
GeoIP2-ruby
Ruby API for GeoIP2 webservice client and database reader
Stars: ✭ 41 (-24.07%)
Mutual labels:  geoip2, geoip, maxmind
MaxMind-DB-Reader-python
Python MaxMind DB reader extension
Stars: ✭ 131 (+142.59%)
Mutual labels:  geoip2, geoip, maxmind
MaxMind-DB-Reader-ruby
Ruby reader for the MaxMind DB Database Format
Stars: ✭ 35 (-35.19%)
Mutual labels:  geoip2, geoip, maxmind
nodejs-geoip2ws
Maxmind GeoIP2 Web Services for Node.js
Stars: ✭ 47 (-12.96%)
Mutual labels:  geoip2, geoip, maxmind
GeoIP2-CN
小巧精悍、准确、实用 GeoIP2 数据库
Stars: ✭ 3,965 (+7242.59%)
Mutual labels:  geoip2, geoip
pf-azure-sentinel
Parse pfSense/OPNSense logs using Logstash, GeoIP tag entities, add additional context to logs, then send to Azure Sentinel for analysis.
Stars: ✭ 24 (-55.56%)
Mutual labels:  geoip, maxmind
GeoLite2-City
GeoLite2-City.mmdb.gz CDN files based on Free Open Source CDN jsDelivr!
Stars: ✭ 170 (+214.81%)
Mutual labels:  geoip, maxmind
sawmill
Sawmill is a JSON transformation Java library
Stars: ✭ 92 (+70.37%)
Mutual labels:  geoip, maxmind
GeoLite2-Country
GeoLite2-Country.mmdb.gz CDN files based on Free Open Source CDN jsDelivr!
Stars: ✭ 69 (+27.78%)
Mutual labels:  geoip, maxmind
locus
MMDB reader for geolocation and ASN lookup of IP addresses
Stars: ✭ 93 (+72.22%)
Mutual labels:  geoip2, geoip
lua-resty-maxminddb
A Lua library for reading MaxMind's Geolocation database
Stars: ✭ 72 (+33.33%)
Mutual labels:  geoip, maxmind
Iploc
Fastest IP To Country Library
Stars: ✭ 224 (+314.81%)
Mutual labels:  geoip
Django Easy Timezones
Easy timezones for Django based on GeoIP
Stars: ✭ 195 (+261.11%)
Mutual labels:  geoip
Docker Elastic Stack
ELK Stack Dockerfile
Stars: ✭ 175 (+224.07%)
Mutual labels:  geoip

Software License Go Report Card Go Doc

GeoIP2 Reader for Go

This library reads MaxMind GeoIP2 databases.

Inspired by oschwald/geoip2-golang.

Installation

go get github.com/IncSW/geoip2

Quick Start

import "github.com/IncSW/geoip2"

reader, err := geoip2.NewCityReaderFromFile("path/to/GeoIP2-City.mmdb")
if err != nil {
	panic(err)
}
record, err := reader.Lookup(net.ParseIP("81.2.69.142"))
if err != nil {
	panic(err)
}
println(record.Continent.Names["zh-CN"]) // 欧洲
println(record.City.Names["pt-BR"]) // Wimbledon
if len(record.Subdivisions) != 0 {
	println(record.Subdivisions[0].Names["en"]) // England
}
println(record.Country.Names["ru"]) // Великобритания
println(record.Country.ISOCode) // GB
println(record.Location.TimeZone) // Europe/London
println(record.Country.GeoNameID) // 2635167, https://www.geonames.org/2635167

Performance

IncSW/geoip2

city-24                          342847    2981 ns/op   2032 B/op    12 allocs/op
city_parallel-24                4477626     269 ns/op   2032 B/op    12 allocs/op
isp-24                          3539738     336 ns/op     64 B/op     1 allocs/op
isp_parallel-24                46938070    25.7 ns/op     64 B/op     1 allocs/op
connection_type-24              8759110     133 ns/op      0 B/op     0 allocs/op
connection_type_parallel-24   142261742    8.34 ns/op      0 B/op     0 allocs/op

oschwald/geoip2-golang

city-24                          109092   10717 ns/op   2848 B/op   103 allocs/op
city_parallel-24                 662510    1718 ns/op   2848 B/op   103 allocs/op
isp-24                          1688287     705 ns/op    112 B/op     4 allocs/op
isp_parallel-24                14285560    84.4 ns/op    112 B/op     4 allocs/op
connection_type-24              3883234     305 ns/op     32 B/op     2 allocs/op
connection_type_parallel-24    34284831    32.1 ns/op     32 B/op     2 allocs/op

Supported databases types

Country

  • GeoIP2-Country
  • GeoLite2-Country
  • DBIP-Country
  • DBIP-Country-Lite

City

  • GeoIP2-City
  • GeoLite2-City
  • GeoIP2-Enterprise
  • DBIP-City-Lite

ISP

  • GeoIP2-ISP

ASN

  • GeoLite2-ASN
  • DBIP-ASN-Lite
  • DBIP-ASN-Lite (compat=GeoLite2-ASN)

Connection Type

  • GeoIP2-Connection-Type

Anonymous IP

  • GeoIP2-Anonymous-IP

Domain

  • GeoIP2-Domain

License

MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].