feat(botfilter): add clientCache
This commit is contained in:
1 parent
9f8f6e289a
commit
1903429d81
1 file changed
+16
@@ -33,3 +33,19 @@ type cacheResult struct {
|
||||
score int
|
||||
}
|
||||
|
||||
// clientCache deliberately has no background goroutine. A middleware
|
||||
// instance can be discarded on a Traefik reload without needing goroutine
|
||||
// cleanup, and opportunistic cleanup keeps its memory use bounded.
|
||||
type clientCache struct {
|
||||
mu sync.Mutex
|
||||
entries map[string]*clientState
|
||||
maxEntries int
|
||||
maxEvents int
|
||||
scoreWindow time.Duration
|
||||
banDuration time.Duration
|
||||
threshold int
|
||||
randomPaths []string
|
||||
randomScore int
|
||||
operations uint64
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user