Skip to content

mostafa-asg/ip2country

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status Go Report Card
ip2country is a golang package to find out IP's origin country. It uses db-ip.com's csv file to provide answers.

Install

go get -u github.com/mostafa-asg/ip2country

Usage

package main

import (
   "github.com/mostafa-asg/ip2country"
)

func main() {
   ip2country.Load( PATH_TO_DB-IP.COM'S CSV FILE )
   println(ip2country.GetCountry("2.179.6.12"))
   println(ip2country.GetCountry("172.217.18.14"))
   println(ip2country.GetCountry("217.160.123.58"))
}

Tips : Load method should be called once.

Releases

No releases published

Packages

No packages published

Languages