retrytx

package module
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2019 License: MIT Imports: 4 Imported by: 0

README

retrytx

Build Status GitHub release Go Report Card GoDoc

Retry database transactions

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RetryTx

func RetryTx(
	ctx context.Context,
	db *sql.DB,
	worker func(context.Context, *sql.Tx) error,
	opts ...Option,
) (err error)

RetryTx retries worker while it returns error. Each retry starts with new transaction.

func RetryTxx

func RetryTxx(
	ctx context.Context,
	db *sqlx.DB,
	worker func(context.Context, *sqlx.Tx) error,
	opts ...Option,
) (err error)

RetryTxx retries worker while it returns error. Each retry starts with new transaction.

Types

type Option

type Option func(*Options)

func WithBackOff

func WithBackOff(b backoff.BackOff) Option

type Options

type Options struct {
	BackOff backoff.BackOff
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL