using constants for sharditeratortype instead of string literals

This commit is contained in:
Farhan 2019-02-03 13:28:57 +05:30
parent 2f0c13ed72
commit 249baa2c72

View file

@ -72,7 +72,7 @@ func New(streamName string, opts ...Option) (*Consumer, error) {
// new consumer with no-op checkpoint, counter, and logger // new consumer with no-op checkpoint, counter, and logger
c := &Consumer{ c := &Consumer{
streamName: streamName, streamName: streamName,
initialShardIteratorType: "TRIM_HORIZON", initialShardIteratorType: kinesis.ShardIteratorTypeTrimHorizon,
checkpoint: &noopCheckpoint{}, checkpoint: &noopCheckpoint{},
counter: &noopCounter{}, counter: &noopCounter{},
logger: &noopLogger{ logger: &noopLogger{
@ -280,7 +280,7 @@ func (c *Consumer) getShardIterator(streamName, shardID, lastSeqNum string) (*st
} }
if lastSeqNum != "" { if lastSeqNum != "" {
params.ShardIteratorType = aws.String("AFTER_SEQUENCE_NUMBER") params.ShardIteratorType = aws.String(kinesis.ShardIteratorTypeAfterSequenceNumber)
params.StartingSequenceNumber = aws.String(lastSeqNum) params.StartingSequenceNumber = aws.String(lastSeqNum)
} else { } else {
params.ShardIteratorType = aws.String(c.initialShardIteratorType) params.ShardIteratorType = aws.String(c.initialShardIteratorType)