MCPcopy Index your code
hub / github.com/ZenNotes/zennotes / newAttemptLimiter

Function newAttemptLimiter

apps/server/internal/httpserver/security.go:142–148  ·  view source on GitHub ↗
(window time.Duration, maxHits int)

Source from the content-addressed store, hash-verified

140}
141
142func newAttemptLimiter(window time.Duration, maxHits int) *attemptLimiter {
143 return &attemptLimiter{
144 window: window,
145 maxHits: maxHits,
146 hits: make(map[string][]time.Time),
147 }
148}
149
150func (l *attemptLimiter) allow(key string) bool {
151 if strings.TrimSpace(key) == "" {

Calls

no outgoing calls