2018-07-29 05:53:33 +00:00
|
|
|
package consumer
|
|
|
|
|
|
2018-11-07 23:45:13 +00:00
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
)
|
|
|
|
|
|
2018-07-29 05:53:33 +00:00
|
|
|
// Checkpoint interface used track consumer progress in the stream
|
|
|
|
|
type Checkpoint interface {
|
2018-11-07 23:45:13 +00:00
|
|
|
Get(ctx context.Context, streamName, shardID string) (string, error)
|
|
|
|
|
Set(ctx context.Context, streamName, shardID, sequenceNumber string) error
|
2018-07-29 05:53:33 +00:00
|
|
|
}
|
|
|
|
|
|
2018-07-29 17:13:03 +00:00
|
|
|
// noopCheckpoint implements the checkpoint interface with discard
|
2018-07-29 05:53:33 +00:00
|
|
|
type noopCheckpoint struct{}
|
|
|
|
|
|
2018-11-07 23:45:13 +00:00
|
|
|
func (n noopCheckpoint) Set(context.Context, string, string, string) error { return nil }
|
|
|
|
|
func (n noopCheckpoint) Get(context.Context, string, string) (string, error) { return "", nil }
|