实现IP名单管理

This commit is contained in:
GoEdgeLab
2020-11-07 19:40:24 +08:00
parent b4896e03a2
commit 48a3a28f32
11 changed files with 567 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
package models
import (
_ "github.com/go-sql-driver/mysql"
"runtime"
"testing"
)
func TestIPListDAO_IncreaseVersion(t *testing.T) {
dao := NewIPListDAO()
version, err := dao.IncreaseVersion(1)
if err != nil {
t.Fatal(err)
}
t.Log("version:", version)
}
func BenchmarkIPListDAO_IncreaseVersion(b *testing.B) {
runtime.GOMAXPROCS(1)
dao := NewIPListDAO()
for i := 0; i < b.N; i++ {
_, _ = dao.IncreaseVersion(1)
}
}