platform: modularize api/gui, add docs-tests-web foundation, and refresh root config
This commit is contained in:
32
selective-vpn-api/app/resolver_dns_policy.go
Normal file
32
selective-vpn-api/app/resolver_dns_policy.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
type dnsAttemptPolicy struct {
|
||||
TryLimit int
|
||||
DomainBudget time.Duration
|
||||
StopOnNX bool
|
||||
}
|
||||
|
||||
type dnsCooldownState struct {
|
||||
Attempts int
|
||||
TimeoutLike int
|
||||
FailStreak int
|
||||
BanUntil int64
|
||||
BanLevel int
|
||||
}
|
||||
|
||||
type dnsRunCooldown struct {
|
||||
mu sync.Mutex
|
||||
enabled bool
|
||||
minAttempts int
|
||||
timeoutRatePct int
|
||||
failStreak int
|
||||
banSec int
|
||||
maxBanSec int
|
||||
temporaryAsError bool
|
||||
byUpstream map[string]*dnsCooldownState
|
||||
}
|
||||
Reference in New Issue
Block a user