项目作者: wangtuanjie

项目描述 :
IP location data for Golang
高级语言: Go
项目地址: git://github.com/wangtuanjie/ip17mon.git
创建时间: 2015-01-20T07:29:43Z
项目社区:https://github.com/wangtuanjie/ip17mon

开源协议:MIT License

下载


17mon IP location data for Golang

Circle CI

特性

  • dat/datx 只支持 ipv4
  • ipdb 支持 ipv4/ipv6

安装

  1. go get github.com/wangtuanjie/ip17mon@latest

使用

  1. import
  2. "fmt"
  3. "github.com/wangtuanjie/ip17mon"
  4. func init() {
  5. ip17mon.Init("your data file")
  6. }
  7. func main() {
  8. loc, err := ip17mon.Find("116.228.111.18")
  9. if err != nil {
  10. fmt.Println("err:", err)
  11. return
  12. }
  13. fmt.Println(loc)
  14. }

更多请参考example

许可证

基于 MIT 协议发布