Documentation
¶
Index ¶
- func CreateCompositeKey(dimensions map[string]string) string
- type DynamORMBackend
- func (b *DynamORMBackend) Cleanup(_ context.Context) error
- func (b *DynamORMBackend) Get(_ context.Context, _ string, _ time.Time) (int64, error)
- func (b *DynamORMBackend) GetMultiple(_ context.Context, _ string, windows []time.Time) (map[time.Time]int64, error)
- func (b *DynamORMBackend) Increment(_ context.Context, _ string, _ time.Time) (int64, error)
- func (b *DynamORMBackend) IncrementBy(_ context.Context, _ string, _ time.Time, amount int64) (int64, error)
- func (b *DynamORMBackend) Reset(_ context.Context, _ string, _ time.Time) error
- func (b *DynamORMBackend) SetMetadata(_ context.Context, _ string, _ time.Time, _ 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(_ context.Context) error
Cleanup removes expired entries (usually handled by DynamoDB TTL)
func (*DynamORMBackend) GetMultiple ¶
func (b *DynamORMBackend) GetMultiple(_ context.Context, _ string, windows []time.Time) (map[time.Time]int64, error)
GetMultiple retrieves counts for multiple windows (for sliding window rate limiting)
func (*DynamORMBackend) Increment ¶
Increment atomically increments the counter for the given key and window
func (*DynamORMBackend) IncrementBy ¶
func (b *DynamORMBackend) IncrementBy(_ context.Context, _ string, _ time.Time, amount int64) (int64, error)
IncrementBy atomically increments the counter by the specified amount