Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DynamoStreamsConsumer ¶
type DynamoStreamsConsumer struct {
// contains filtered or unexported fields
}
DynamoStreamsConsumer wraps the interaction with the DynamoStream
func NewDynamoStreamsConsumer ¶
func NewDynamoStreamsConsumer(opts ...Option) (*DynamoStreamsConsumer, error)
NewDynamoStreamsConsumer returns a pointer to a DynamoStreamsConsumer. If no options are passed the DynamoStreamsConsumer is configured with default settings. Use any of the DynamoStreamOption functions to override any of the default settings. For example you can pass your own client that implements dynamodbstreamsiface.DynamoDBStreamsAPI by calling NewDynamoStreamsConsumer(WithDynamoStreamsClient(<your client))
func (*DynamoStreamsConsumer) GetStreamArn ¶
func (d *DynamoStreamsConsumer) GetStreamArn(tableName string) (string, error)
getStreamArn takes a table name and returns the arn of its associated dynamodbstream
func (*DynamoStreamsConsumer) Scan ¶
func (d *DynamoStreamsConsumer) Scan(ctx context.Context, arn string, seqNum string, fn func(*dynamodbstreams.Record) error) error
Scan launches a goroutine to process each of the shards in the stream. The callback function is passed to each of the goroutines and called for each message pulled from the stream. The seqNum parameter is optional and if a SequenceNumber is passed then Scan will start reading from that point on the stream. If you just pass an empty string to seqNum then Scan will read from the DynamoStreamsConsumers initialShardIteratorType. If you haven't overidden the initialShardIteratorType when calling NewDynamoStreamsConsumer it will default to SHARD_ITERATOR_TYPE LATEST
type Option ¶
type Option func(*DynamoStreamsConsumer)
DynamoStreamOption is used to override default values when creating a new DynamoStreamsConsumer
func WithClient ¶
func WithClient(client dynamodbstreamsiface.DynamoDBStreamsAPI) Option
WithClient overrides the default client
func WithLogger ¶
WithLogger overrides the default logger
func WithShardIteratorType ¶
ShardIteratorType overrides the starting point for the consumer