Documentation
¶
Index ¶
- type ModelCallLimiter
- func (l *ModelCallLimiter) CheckLimit(model string) (bool, int, int)
- func (l *ModelCallLimiter) GetUsage() map[string]int
- func (l *ModelCallLimiter) RecordCall(model string) bool
- func (l *ModelCallLimiter) Reset(model string)
- func (l *ModelCallLimiter) ResetAll()
- func (l *ModelCallLimiter) SetLimit(model string, limit int)
- type RateLimitTracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModelCallLimiter ¶
type ModelCallLimiter struct {
// contains filtered or unexported fields
}
func NewModelCallLimiter ¶
func NewModelCallLimiter() *ModelCallLimiter
func (*ModelCallLimiter) CheckLimit ¶
func (l *ModelCallLimiter) CheckLimit(model string) (bool, int, int)
func (*ModelCallLimiter) GetUsage ¶
func (l *ModelCallLimiter) GetUsage() map[string]int
func (*ModelCallLimiter) RecordCall ¶
func (l *ModelCallLimiter) RecordCall(model string) bool
func (*ModelCallLimiter) Reset ¶
func (l *ModelCallLimiter) Reset(model string)
func (*ModelCallLimiter) ResetAll ¶
func (l *ModelCallLimiter) ResetAll()
func (*ModelCallLimiter) SetLimit ¶
func (l *ModelCallLimiter) SetLimit(model string, limit int)
type RateLimitTracker ¶
type RateLimitTracker struct {
// contains filtered or unexported fields
}
func NewRateLimitTracker ¶
func NewRateLimitTracker() *RateLimitTracker
func (*RateLimitTracker) GetAll ¶
func (t *RateLimitTracker) GetAll() map[string]int
func (*RateLimitTracker) GetCount ¶
func (t *RateLimitTracker) GetCount(model string, window time.Duration) int
func (*RateLimitTracker) Record ¶
func (t *RateLimitTracker) Record(model string, statusCode int)
Click to show internal directories.
Click to hide internal directories.