Documentation
¶
Index ¶
- func CreateCompositeKey(dimensions map[string]string) string
- type DynamORMBackend
- func (b *DynamORMBackend) Cleanup(ctx context.Context) error
- func (b *DynamORMBackend) Get(ctx context.Context, key string, window time.Time) (int64, error)
- func (b *DynamORMBackend) GetMultiple(ctx context.Context, key string, windows []time.Time) (map[time.Time]int64, error)
- func (b *DynamORMBackend) Increment(ctx context.Context, key string, window time.Time) (int64, error)
- func (b *DynamORMBackend) IncrementBy(ctx context.Context, key string, window time.Time, amount int64) (int64, error)
- func (b *DynamORMBackend) Reset(ctx context.Context, key string, window time.Time) error
- func (b *DynamORMBackend) SetMetadata(ctx context.Context, key string, window time.Time, metadata map[string]string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCompositeKey ¶
CreateCompositeKey creates a composite key for multi-dimensional rate limiting
Types ¶
type DynamORMBackend ¶
type DynamORMBackend struct {
}
DynamORMBackend implements the Limited library backend interface using DynamORM Note: This is a placeholder implementation. The actual implementation would depend on the DynamORM client being available in the Lambda runtime.
func NewDynamORMBackend ¶
func NewDynamORMBackend() *DynamORMBackend
NewDynamORMBackend creates a new DynamORM backend for the Limited library
func (*DynamORMBackend) Cleanup ¶
func (b *DynamORMBackend) Cleanup(ctx context.Context) error
Cleanup removes expired entries (usually handled by DynamoDB TTL)
func (*DynamORMBackend) GetMultiple ¶
func (b *DynamORMBackend) GetMultiple(ctx context.Context, key string, windows []time.Time) (map[time.Time]int64, error)
GetMultiple retrieves counts for multiple windows (for sliding window rate limiting)
func (*DynamORMBackend) Increment ¶
func (b *DynamORMBackend) Increment(ctx context.Context, key string, window time.Time) (int64, error)
Increment atomically increments the counter for the given key and window
func (*DynamORMBackend) IncrementBy ¶
func (b *DynamORMBackend) IncrementBy(ctx context.Context, key string, window time.Time, amount int64) (int64, error)
IncrementBy atomically increments the counter by the specified amount