Documentation
¶
Overview ¶
Package checkpoint expose the Checkpointer interface, used to checkpoint, or save, the current progress of a Subscription, so that it might survive application restarts without reprocessing Events.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NopCheckpointer = FixedCheckpointer{StartingFrom: 0}
NopCheckpointer is a Checkpointer implementation that always restarts from the beginning.
Functions ¶
This section is empty.
Types ¶
type Checkpointer ¶
type Checkpointer interface { Read(ctx context.Context, key string) (int64, error) Write(ctx context.Context, key string, sequenceNumber int64) error }
Checkpointer represents a component that contains the current state of progress of a named Subscription, so that the Subscription can be restored from where it left off, in case of application restart.
type CheckpointerMock ¶
type CheckpointerMock struct { // ReadFn is the function called on checkpoint.Checkpointer.Read. ReadFn func(ctx context.Context, key string) (int64, error) // WriteFn is the function called on checkpoint.Checkpointer.Write. WriteFn func(ctx context.Context, key string, sequenceNumber int64) error }
CheckpointerMock is a mock implementation of a checkpoint.Checkpointer.
type FixedCheckpointer ¶
type FixedCheckpointer struct{ StartingFrom int64 }
FixedCheckpointer is a Checkpointer implementation that always restarts from the specified starting point.