Versions in this module Expand all Collapse all v1 v1.3.0 Oct 23, 2026 Changes in this version + const DefaultBruteForceLimit + const DefaultBruteForceWindow + const DefaultKeyTTL + func HashIdentifier(identifier string) string + type KeyRecord struct + CreatedAt time.Time + ExpiresAt *time.Time + ID string + KeyHash string + LastUsedAt *time.Time + LastUsedIP string + LastUsedUA string + Metadata map[string]string + Name string + OrganizationID string + Permissions []string + Prefix string + RevokedAt *time.Time + Scopes []string + ServiceID string + UpdatedAt time.Time + UserID string + type Limiter struct + func NewLimiter(c corecache.Cache, maxAttempts int, window time.Duration, keyTTL time.Duration) *Limiter + func (l *Limiter) CheckRateLimit(ctx context.Context, identifier string) (bool, error) + func (l *Limiter) GetKey(ctx context.Context, keyHash string) (*KeyRecord, error) + func (l *Limiter) Invalidate(ctx context.Context, id string, keyHash string) error + func (l *Limiter) RecordFailure(ctx context.Context, identifier string) error + func (l *Limiter) SetKey(ctx context.Context, key *KeyRecord) error