Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMaxBackoffReached = errors.New("backoff: max backoff reached")
ErrMaxBackoffReached is returned when the maximum backoff count has been reached.
Functions ¶
This section is empty.
Types ¶
type Backoff ¶
Backoff function to retry during batch writes.
func NewBackoff ¶
NewBackoff creates a backoff function. Retry Backoff Total elapsed 0 0 0 1 200 0.2 2 400 0.6 3 800 1.4 4 1600 3 5 3200 6.2 6 6400 12.6 7 12800 25.4
type BatchWriter ¶
type BatchWriter struct { Backoff Backoff // contains filtered or unexported fields }
BatchWriter writes to DynamoDB tables using BatchWriteItem.
func New ¶
func New(region, tableName string) (bw BatchWriter, err error)
New creates a new BatchWriter to write to a DynamoDB table in batches. It uses the default Backoff implementation which provides up to 7 retries costing 25 seconds of latency before failing the entire batch.
func (BatchWriter) Write ¶
func (bw BatchWriter) Write(records []map[string]*dynamodb.AttributeValue) (err error)
Write to DynamoDB using BatchWriteItem.
Click to show internal directories.
Click to hide internal directories.