repositories

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimitRepository

type RateLimitRepository interface {
	GetByKey(ctx context.Context, key string) (*types.RateLimit, error)
	UpdateOrCreate(ctx context.Context, key string, window time.Duration) (*types.RateLimit, error)
	CleanupExpired(ctx context.Context, now time.Time) error
	SetRule(ctx context.Context, key string, windowSeconds int, maxRequests int) error
	GetRule(ctx context.Context, key string) (*types.RateLimitRuleRecord, error)
	DeleteRule(ctx context.Context, key string) error
}

func NewRateLimitRepository

func NewRateLimitRepository(db bun.IDB) RateLimitRepository

Jump to

Keyboard shortcuts

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