Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumption ¶
Consumption represents a single tea consumption event.
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore is a simple in-memory implementation of Store. It is process-local and not persisted across restarts.
func NewMemoryStore ¶
func NewMemoryStore(retention time.Duration) *MemoryStore
type Store ¶
type Store interface {
Record(ctx context.Context, userID uuid.UUID, teaID uuid.UUID, ts time.Time) error
// Recent returns consumptions since the provided time (inclusive) for the given user.
Recent(ctx context.Context, userID uuid.UUID, since time.Time) ([]Consumption, error)
}
Store defines operations for recording and querying recent tea consumption.
Click to show internal directories.
Click to hide internal directories.