Skip to content

wangtuanjie/ip17mon

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

17mon IP location data for Golang

Circle CI

特性

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

安装

go get github.com/wangtuanjie/ip17mon@latest

使用

import (
	"fmt"
	"github.com/wangtuanjie/ip17mon"
)

func init() {
	ip17mon.Init("your data file")
}

func main() {
	loc, err := ip17mon.Find("116.228.111.18")
	if err != nil {
		fmt.Println("err:", err)
		return
	}
	fmt.Println(loc)
}

更多请参考example

许可证

基于 MIT 协议发布