update ipv4
continuous-integration/drone/push Build is passing Details

master v1.0.14
李光春 2 years ago
parent 8e7c572b9d
commit 8b5684e301

@ -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.

@ -8,8 +8,6 @@ import (
"strings"
)
const Version = "1.0.13"
type App struct {
V4Region ip2region.Ip2Region // IPV4
V4db v4.Pointer // IPV4

@ -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"))
}
}

Binary file not shown.

@ -0,0 +1,3 @@
package goip
const Version = "1.0.14"
Loading…
Cancel
Save