Skip to content
This repository has been archived by the owner on Jun 5, 2018. It is now read-only.

polds/GeoIP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GeoIP

GeoIP is a FreeGeoIP API abstraction library written in Go like the original package. This package utilizes the freely available RESTful API found on their website. API Documentation on go.pkgdoc.org.

go get github.com/polds/GeoIP
package main

import (
	"fmt"
	"github.com/polds/GeoIP"
)

func main() {
	info, err := GeoIP.Fetch("127.0.0.1")
	if err != nil {
		panic(err) // Could be rate limiting or not found
	}

	fmt.Println(info.City)
	fmt.Println(info.CountryCode)
}

GoConvey is used in this library for testing. Testing can be done two different ways:

go test -v

or likewise you can run the GoConvey web UI to run the tests

goconvey .
  • As of February 19, 2014 this library is considered complete. No additional features will be added. Should a Go version change require any changes to the library it will be updated. Please be aware this is not an abandoned project but is used on a daily basis.
  • This library has been run through golint.

Any feature requets, comments, concerns are welcome: @Peter_Olds

About

A FreeGeoIP API abstraction written in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages