Documentation
¶
Overview ¶
Package idstore implements the (principal, idempotency_key) → job_id dedupe map. Implementations may persist; the default is in-memory with a TTL sweep.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory is an in-memory Store with a 24h default TTL.
func (*Memory) PutIfAbsent ¶
PutIfAbsent inserts e if no entry exists for (principal, key).
type Store ¶
type Store interface {
PutIfAbsent(ctx context.Context, e Entry) (Entry, bool, error)
Get(ctx context.Context, principal, key string) (Entry, bool, error)
Sweep(ctx context.Context, olderThan time.Time) (int, error)
}
Store is the dedupe interface. PutIfAbsent inserts entry and returns the stored entry plus true if the row is new; if a row already exists, it returns the existing entry and false.
Click to show internal directories.
Click to hide internal directories.