diff --git a/stream/stream.go b/stream/stream.go index 8927387..52d025b 100644 --- a/stream/stream.go +++ b/stream/stream.go @@ -6,24 +6,27 @@ import ( "errors" "time" + "sync" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/dynamodb" + "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface" "github.com/aws/aws-sdk-go/service/dynamodbstreams" - "sync" + "github.com/aws/aws-sdk-go/service/dynamodbstreams/dynamodbstreamsiface" ) type StreamSubscriber struct { - dynamoSvc *dynamodb.DynamoDB - streamSvc *dynamodbstreams.DynamoDBStreams + dynamoSvc dynamodbiface.DynamoDBAPI + streamSvc dynamodbstreamsiface.DynamoDBStreamsAPI table *string ShardIteratorType *string Limit *int64 } func NewStreamSubscriber( - dynamoSvc *dynamodb.DynamoDB, - streamSvc *dynamodbstreams.DynamoDBStreams, + dynamoSvc dynamodbiface.DynamoDBAPI, + streamSvc dynamodbstreamsiface.DynamoDBStreamsAPI, table string) *StreamSubscriber { s := &StreamSubscriber{dynamoSvc: dynamoSvc, streamSvc: streamSvc, table: &table} s.applyDefaults() @@ -189,7 +192,7 @@ func (r *StreamSubscriber) findProperShardId(previousShardId *string) (shadrId * return } - for i, shard := range des.StreamDescription.Shards { + for _, shard := range des.StreamDescription.Shards { shadrId = shard.ShardId if shard.ParentShardId != nil && *shard.ParentShardId == *previousShardId { return