cache

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2026 License: MIT, MIT Imports: 4 Imported by: 0

Documentation

Overview

Package cache provides rate limiting and temporary throttle helpers for device authorization. The persistent store remains the authoritative source of truth for all device grant state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimiter

type RateLimiter interface {
	// Allow checks if the request with key is within limit for window.
	Allow(ctx context.Context, key string, limit int64, window time.Duration) (bool, error)
}

RateLimiter provides rate limiting checks to prevent brute-forcing user codes.

func NewRateLimiter

func NewRateLimiter(c corecache.Cache) RateLimiter

NewRateLimiter creates a RateLimiter wrapping Core's cache adapter or an in-memory fallback.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL