feat(blacklist): 支持 hosts 风格黑名单文件并优化热重载机制
- 支持解析 hosts 风格的黑名单文件,可识别以 IP 开头的行,并将后续字段作为域名处理 - 增加对行首及行内注释的支持(支持 `//`、`#`、`;` 符号) - 使用 atomic.Pointer 管理黑名单匹配器,提升并发安全性 - 优化黑名单热重载逻辑,使用 time.Ticker 替代 time.After 提高稳定性 - 更新相关依赖引用路径,调整 sync 包导入位置
This commit is contained in:
2
go.mod
2
go.mod
@@ -5,13 +5,13 @@ go 1.25.3
|
||||
require (
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7
|
||||
github.com/miekg/dns v1.1.68
|
||||
golang.org/x/sync v0.17.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
golang.org/x/mod v0.29.0 // indirect
|
||||
golang.org/x/net v0.46.0 // indirect
|
||||
golang.org/x/sync v0.17.0 // indirect
|
||||
golang.org/x/sys v0.37.0 // indirect
|
||||
golang.org/x/tools v0.38.0 // indirect
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user