mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-18 11:50:26 +08:00
自动检测本地数据库磁盘是否已满,如果已满,则不再写入访问日志
This commit is contained in:
@@ -4,6 +4,7 @@ package dbutils_test
|
||||
|
||||
import (
|
||||
dbutils "github.com/TeaOSLab/EdgeAPI/internal/db/utils"
|
||||
"github.com/iwind/TeaGo/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -12,3 +13,13 @@ func TestQuoteLike(t *testing.T) {
|
||||
t.Log(s + " => " + dbutils.QuoteLike(s))
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsLocalAddr(t *testing.T) {
|
||||
var a = assert.NewAssertion(t)
|
||||
a.IsTrue(dbutils.IsLocalAddr("127.0.0.1"))
|
||||
a.IsTrue(dbutils.IsLocalAddr("localhost"))
|
||||
a.IsTrue(dbutils.IsLocalAddr("::1"))
|
||||
a.IsTrue(dbutils.IsLocalAddr("127.0.0.1:3306"))
|
||||
a.IsFalse(dbutils.IsLocalAddr("192.168.2.200"))
|
||||
a.IsFalse(dbutils.IsLocalAddr("192.168.2.200:3306"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user