Documentation ¶
Overview ¶
Package util contains common utility code for storage operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Canceled context.Context
Canceled is an already-canceled context.
var ErrVersionSkew = errors.New("version skew")
ErrVersionSkew is returned from methods that operate on versioned data to indicate that the caller should refresh before retrying the operation.
Functions ¶
func Retry ¶
Retry is a convenience wrapper to automatically retry idempotent database operations that experience a transaction or or connection failure. The provided callback must be entirely idempotent, with no observable side-effects during its execution.
func RetryLoop ¶
RetryLoop is a convenience wrapper to automatically retry idempotent database operations that experience a transaction or or connection failure. The provided callback may indicate that it has started generating observable effects (e.g. sending result data) by calling its second parameter to disable the retry behavior.