19 lines
535 B
Go
19 lines
535 B
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
)
|
|
|
|
// IdempotencyCache stores a serialized notification result for deduplication.
|
|
type IdempotencyCache interface {
|
|
Get(ctx context.Context, key string) ([]byte, error)
|
|
Set(ctx context.Context, key string, value []byte, ttl time.Duration) error
|
|
}
|
|
|
|
// QuotaCounter tracks per-tenant daily send counts.
|
|
type QuotaCounter interface {
|
|
// Incr returns the count after increment (1-based on first incr of the day).
|
|
Incr(ctx context.Context, key string, ttl time.Duration) (int64, error)
|
|
}
|