Documentation
¶
Index ¶
- Constants
- Variables
- func WithDeploymentID(deploymentID string) func(opts *IdempotenceImplOptions)
- func WithSuccessfulTTL(successfulTTL time.Duration) func(opts *IdempotenceImplOptions)
- func WithTimeout(timeout time.Duration) func(opts *IdempotenceImplOptions)
- type Idempotence
- type IdempotenceImpl
- type IdempotenceImplOptions
Constants ¶
View Source
const ( DefaultTimeout = 5 * time.Second // 5 seconds DefaultSuccessfulTTL = 24 * time.Hour // 24 hours StatusProcessing = "processing" StatusProcessed = "processed" )
Variables ¶
View Source
var ErrConflict = errors.New("conflict")
Functions ¶
func WithDeploymentID ¶ added in v0.13.0
func WithDeploymentID(deploymentID string) func(opts *IdempotenceImplOptions)
func WithSuccessfulTTL ¶
func WithSuccessfulTTL(successfulTTL time.Duration) func(opts *IdempotenceImplOptions)
func WithTimeout ¶
func WithTimeout(timeout time.Duration) func(opts *IdempotenceImplOptions)
Types ¶
type Idempotence ¶
type Idempotence interface {
Exec(ctx context.Context, key string, exec func(context.Context) error) error
}
func New ¶
func New(redisClient redis.Cmdable, opts ...func(opts *IdempotenceImplOptions)) Idempotence
type IdempotenceImpl ¶
type IdempotenceImpl struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.