Documentation
¶
Index ¶
- Constants
- func BalanceInternalKey(organizationID, ledgerID uuid.UUID, key string) string
- func FullJitter(baseDelay time.Duration) time.Duration
- func GenericInternalKey(name, contextName, organizationID, ledgerID, key string) string
- func IdempotencyReverseKey(organizationID, ledgerID uuid.UUID, transactionID string) string
- func NextBackoff(current time.Duration) time.Duration
- func RedisConsumerLockKey(organizationID, ledgerID uuid.UUID, transactionID string) string
- func TransactionInternalKey(organizationID, ledgerID uuid.UUID, key string) string
Constants ¶
const ( MaxRetries = 5 InitialBackoff = 500 * time.Millisecond MaxBackoff = 10 * time.Second BackoffFactor = 2.0 )
Variables ¶
This section is empty.
Functions ¶
func BalanceInternalKey ¶ added in v3.3.6
BalanceInternalKey returns a key with the following format to be used on redis cluster: "balance:{contextName}:organizationID:ledgerID:key"
func FullJitter ¶
FullJitter returns a random delay between [0, baseDelay], capped by MaxBackoff.
func GenericInternalKey ¶ added in v3.3.6
GenericInternalKey returns a key with the following format to be used on redis cluster: "name:{contextName}:organizationID:ledgerID:key"
func IdempotencyReverseKey ¶ added in v3.3.11
IdempotencyReverseKey returns a key with the following format to be used on redis cluster: "idempotency_reverse:{organizationID:ledgerID}:transactionID" This key maps a transactionID to its idempotency key for reverse lookups.
func NextBackoff ¶
NextBackoff calculates the next exponential backoff, respecting the MaxBackoff capped.
func RedisConsumerLockKey ¶ added in v3.3.11
RedisConsumerLockKey returns a key with the following format to be used on redis cluster: "redis_consumer_lock:{organizationID:ledgerID}:transactionID" This key is used to prevent duplicate processing of the same transaction across multiple pods.
Types ¶
This section is empty.