Skip to content

cevatbarisyilmaz/ip2country

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ip2country

GoDoc GitHub release (latest SemVer) GitHub Go Report Card

Package ip2country uses https://github.com/oschwald/maxminddb-golang with an embedded GeoLite2 DB to map net.IPs to country ISO codes without dealing with DB files.

Example

country, _ := ip2country.Country(net.IPv4(8, 8, 8, 8))
fmt.Println(country)
// Output: US

This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com