* Introduce Group interface and AllGroup As we move towards consumer groups we'll need to support the current "consume all shards" strategy, and setup the codebase for the anticipated "consume balanced shards."
14 lines
349 B
Go
14 lines
349 B
Go
package consumer
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/aws/aws-sdk-go/service/kinesis"
|
|
)
|
|
|
|
// Group interface used to manage which shard to process
|
|
type Group interface {
|
|
Start(ctx context.Context, shardc chan *kinesis.Shard)
|
|
GetCheckpoint(streamName, shardID string) (string, error)
|
|
SetCheckpoint(streamName, shardID, sequenceNumber string) error
|
|
}
|