geoip

GeoIP API for Golang

  • 所有者: abh/geoip
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

GeoIP API for Go

This package wraps the libgeoip C library for
access from Go (golang). Build Status

Install with go get github.com/abh/geoip and use godoc
geoip
to read the documentation.

There's a small example in the ex/ subdirectory.

You can download the free GeoLite
Country
database or you can
subscribe to updates.

Examples

file := "/usr/share/GeoIP/GeoIP.dat"

gi, err := geoip.Open(file)
if err != nil {
	fmt.Printf("Could not open GeoIP database\n")
}

if gi != nil {
	country, netmask := gi.GetCountry("207.171.7.51")
}

// Setup gi6 by opening the optional IPv6 database and then...
country := gi6.GetCountry_v6("2607:f238:2::5")
fmt.Println(country)

Contact

Copyright 2012-2013 Ask Bjørn Hansen ask@develooper.com. The package
is MIT licensed, see the LICENSE file. Originally based on example code
from blasux@blasux.ru.

主要指标

概览
名称与所有者abh/geoip
主编程语言Go
编程语言Go (语言数: 2)
平台
许可证MIT License
所有者活动
创建于2012-08-20 23:25:36
推送于2019-05-22 05:20:53
最后一次提交2016-05-10 08:55:16
发布数0
用户参与
星数232
关注者数14
派生数65
提交数72
已启用问题?
问题数14
打开的问题数9
拉请求数8
打开的拉请求数8
关闭的拉请求数4
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?