mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-02-27 01:07:10 +00:00
chore: cleanup the patch code
This commit is contained in:
@@ -29,6 +29,7 @@ type dnsClient interface {
|
||||
type dnsCache interface {
|
||||
GetWithExpire(key string) (*D.Msg, time.Time, bool)
|
||||
SetWithExpire(key string, value *D.Msg, expire time.Time)
|
||||
Clear()
|
||||
}
|
||||
|
||||
type result struct {
|
||||
@@ -369,6 +370,12 @@ func (r *Resolver) Invalid() bool {
|
||||
return len(r.main) > 0
|
||||
}
|
||||
|
||||
func (r *Resolver) ClearCache() {
|
||||
if r != nil && r.cache != nil {
|
||||
r.cache.Clear()
|
||||
}
|
||||
}
|
||||
|
||||
type NameServer struct {
|
||||
Net string
|
||||
Addr string
|
||||
|
||||
Reference in New Issue
Block a user