Skip to content

Commit 546f4d2

Browse files
committed
update
1 parent 0e65809 commit 546f4d2

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,25 @@ import (
1818
)
1919

2020
func main() {
21-
db, err := ipdb.New("c:/work/tiantexin/bb/v6/mydata6vipday4.ipdb")
21+
22+
// 支持IPDB格式地级市精度IP离线库(免费版,每周高级版,每日标准版,每日高级版,每日专业版,每日旗舰版)
23+
db, err := ipdb.NewCity("/path/to/city.ipv4.ipdb")
2224
if err != nil {
2325
log.Fatal(err)
2426
}
25-
fmt.Println("IPv6 Support:", db.IsIPv6Support()) // Whether IPv6 is supported
26-
fmt.Println("IPv4 Support:", db.IsIPv4Support()) // Whether IPv4 is supported
27-
fmt.Println("Languages:", db.Languages()) // Supported language items
28-
fmt.Println("UTC Time:", db.Build()) // time.Time UTC
2927

30-
fmt.Println(db.Find("2001:19F0:7000::", "CN"))
31-
fmt.Println(db.FindMap("2001:19F0:7000::", "CN"))
28+
fmt.Println(db.IsIPv4()) // check database support ip type
29+
fmt.Println(db.IsIPv6()) // check database support ip type
30+
fmt.Println(db.BuildTime()) // database build time
31+
fmt.Println(db.Languages()) // database support language
32+
fmt.Println(db.Fields()) // database support fields
33+
34+
fmt.Println(db.FindInfo("2001:250:200::", "CN")) // return CityInfo
35+
fmt.Println(db.Find("1.1.1.1", "CN")) // return []string
36+
fmt.Println(db.FindMap("118.28.8.8", "CN")) // return map[string]string
37+
fmt.Println(db.FindInfo("127.0.0.1", "CN")) // return CityInfo
38+
39+
fmt.Println()
3240
}
3341
</code>
3442
</pre>

0 commit comments

Comments
 (0)