Documentation
¶
Overview ¶
Package webhookidempotency adapts idempotency leases to webhook replay checks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidConfig = errors.New("webhook/idempotency: invalid configuration") ErrInvalidExpiry = errors.New("webhook/idempotency: expiry must be in the future") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Service *idempotency.Service
Namespace string
Tenant string
Operation string
Caller string
Clock func() time.Time
}
Config supplies the durable service and full collision scope.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements webhook.ReplayStore with fail-closed durable leases.
func (*Store) CheckAndRecord ¶
func (s *Store) CheckAndRecord(ctx context.Context, value string, expiresAt time.Time) (bool, error)
CheckAndRecord acquires a lease through idempotency. Acquired and stale takeover outcomes are new records; every retained matching outcome is a replay. Backend unavailability remains an error through fail-closed mode.
Click to show internal directories.
Click to hide internal directories.