v0.11.0 external formatter and sanitizer integrated, refactored

This commit is contained in:
2025-12-10 08:26:46 -05:00
parent 98ace914f7
commit 430f653683
44 changed files with 1656 additions and 1500 deletions

View File

@ -1,4 +1,3 @@
// FILE: src/internal/tokenbucket/bucket.go
package tokenbucket
import (
@ -71,4 +70,18 @@ func (tb *TokenBucket) refill() {
tb.tokens = tb.capacity
}
tb.lastRefill = now
}
// Rate returns the refill rate in tokens per second
func (tb *TokenBucket) Rate() float64 {
tb.mu.Lock()
defer tb.mu.Unlock()
return tb.refillRate
}
// Capacity returns the bucket capacity
func (tb *TokenBucket) Capacity() float64 {
tb.mu.Lock()
defer tb.mu.Unlock()
return tb.capacity
}