diff --git a/LICENSE b/LICENSE deleted file mode 100644 index a0d0e5b..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 茂名聚合科技有限公司 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/app.go b/app.go index cf5479a..0eb23c6 100644 --- a/app.go +++ b/app.go @@ -8,8 +8,6 @@ import ( "strings" ) -const Version = "1.0.13" - type App struct { V4Region ip2region.Ip2Region // IPV4 V4db v4.Pointer // IPV4 diff --git a/app_test.go b/app_test.go index 17de700..64813c0 100644 --- a/app_test.go +++ b/app_test.go @@ -22,3 +22,17 @@ func TestIp(t *testing.T) { t.Logf("%+v", app.V6db.Find("240e:3b4:38e4:3295:7093:af6c:e545:f2e9")) t.Log(app.V4Region.MemorySearch("61.241.55.180")) } + +func BenchmarkIpv4(b *testing.B) { + app.InitIPData() + for i := 0; i < b.N; i++ { + b.Log(app.V4db.Find("61.241.55.180")) + } +} + +func BenchmarkIpv5(b *testing.B) { + app.InitIPData() + for i := 0; i < b.N; i++ { + b.Log(app.V6db.Find("240e:3b4:38e4:3295:7093:af6c:e545:f2e9")) + } +} diff --git a/v4/qqwry.dat b/v4/qqwry.dat index e522d27..555db57 100644 Binary files a/v4/qqwry.dat and b/v4/qqwry.dat differ diff --git a/version.go b/version.go new file mode 100644 index 0000000..306d47c --- /dev/null +++ b/version.go @@ -0,0 +1,3 @@ +package goip + +const Version = "1.0.14"