As we work towards introducing consumer groups to the repository we need a more generic name for the persistence layer for storing checkpoints and leases for given shards. * Rename `checkpoint` to `store`
13 lines
465 B
Go
13 lines
465 B
Go
package consumer
|
|
|
|
// Store interface used to persist scan progress
|
|
type Store interface {
|
|
GetCheckpoint(streamName, shardID string) (string, error)
|
|
SetCheckpoint(streamName, shardID, sequenceNumber string) error
|
|
}
|
|
|
|
// noopStore implements the storage interface with discard
|
|
type noopStore struct{}
|
|
|
|
func (n noopStore) GetCheckpoint(string, string) (string, error) { return "", nil }
|
|
func (n noopStore) SetCheckpoint(string, string, string) error { return nil }
|