Readme and linter fix (#102)
* update readme.md adding goreport * update readme and fix issue found by linter * update readme.md add Go badges * update readme.md, fix go badges
This commit is contained in:
parent
71bbc397e2
commit
a252eb38c6
4 changed files with 5 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
# Golang Kinesis Consumer
|
# Golang Kinesis Consumer
|
||||||
|
|
||||||
[](https://travis-ci.com/harlow/kinesis-consumer) [](https://godoc.org/github.com/harlow/kinesis-consumer)
|
 [](https://travis-ci.com/harlow/kinesis-consumer) [](https://godoc.org/github.com/harlow/kinesis-consumer) [](https://goreportcard.com/report/harlow/kinesis-consumer)
|
||||||
|
|
||||||
__Note:__ This repo is under active development adding [Consumer Groups #42](https://github.com/harlow/kinesis-consumer/issues/42). Master should always be deployable, but expect breaking changes in master over the next few months.
|
__Note:__ This repo is under active development adding [Consumer Groups #42](https://github.com/harlow/kinesis-consumer/issues/42). Master should always be deployable, but expect breaking changes in master over the next few months.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ func WithShardIteratorType(t string) Option {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Timestamp overrides the starting point for the consumer
|
// WithTimestamp overrides the starting point for the consumer
|
||||||
func WithTimestamp(t time.Time) Option {
|
func WithTimestamp(t time.Time) Option {
|
||||||
return func(c *Consumer) {
|
return func(c *Consumer) {
|
||||||
c.initialTimestamp = &t
|
c.initialTimestamp = &t
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ type item struct {
|
||||||
SequenceNumber string `json:"sequence_number"`
|
SequenceNumber string `json:"sequence_number"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get determines if a checkpoint for a particular Shard exists.
|
// GetCheckpoint determines if a checkpoint for a particular Shard exists.
|
||||||
// Typically used to determine whether we should start processing the shard with
|
// Typically used to determine whether we should start processing the shard with
|
||||||
// TRIM_HORIZON or AFTER_SEQUENCE_NUMBER (if checkpoint exists).
|
// TRIM_HORIZON or AFTER_SEQUENCE_NUMBER (if checkpoint exists).
|
||||||
func (c *Checkpoint) GetCheckpoint(streamName, shardID string) (string, error) {
|
func (c *Checkpoint) GetCheckpoint(streamName, shardID string) (string, error) {
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,12 @@ type Retryer interface {
|
||||||
ShouldRetry(error) bool
|
ShouldRetry(error) bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DefaultRetryer .
|
||||||
type DefaultRetryer struct {
|
type DefaultRetryer struct {
|
||||||
Retryer
|
Retryer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ShouldRetry when error occured
|
||||||
func (r *DefaultRetryer) ShouldRetry(err error) bool {
|
func (r *DefaultRetryer) ShouldRetry(err error) bool {
|
||||||
if awsErr, ok := err.(awserr.Error); ok {
|
if awsErr, ok := err.(awserr.Error); ok {
|
||||||
if awsErr.Code() == dynamodb.ErrCodeProvisionedThroughputExceededException {
|
if awsErr.Code() == dynamodb.ErrCodeProvisionedThroughputExceededException {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue