Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultIdempotencyKeyHeader = "Idempotency-Key" DefaultLockDuration = 10 * time.Second )
View Source
const (
RecoveryPointStart = "start"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Locker Locker Repository Repository IdempotencyKeyHeader string }
type IdempotencyKey ¶
type Repository ¶
type Repository interface { // GetOrInsertKey returns the key if it exists, or inserts it if it doesn't. // If the key is inserted, the returned bool is true. GetOrInsert(*IdempotencyKey) (*IdempotencyKey, bool, error) // SetRecoveryPoint sets the recovery point for the key. SetRecoveryPoint(key string, recoveryPoint string) error // SetResponse sets the response fields for the key. SetResponse(key string, statusCode int, headers http.Header, body string) error }
Click to show internal directories.
Click to hide internal directories.