Documentation ¶
Overview ¶
Package checkpoint implements a mechanism for tracking checkpointed integer offsets for sequential read at-least-once queue systems such as Kafka or Kinesis.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrOutOfSync = errors.New("provided offset was out of sync")
ErrOutOfSync is returned when an offset to be tracked is less than or equal to the current highest tracked offset.
var ErrResolvedOffsetNotTracked = errors.New("resolved offset was not tracked")
ErrResolvedOffsetNotTracked is returned when an offset to be resolved has not been tracked (or was already resolved).
Functions ¶
This section is empty.
Types ¶
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
Type receives an ordered feed of integer based offsets being tracked, and an unordered feed of integer based offsets that are resolved, and is able to return the highest offset currently able to be committed such that an unresolved offset is never committed.
WARNING: DEPRECATED TODO: V4 Remove this
func New ¶
New returns a new checkpointer from a base offset, which is the value returned when no checkpoints have yet been resolved. The base can be zero.
func (*Type) MustResolve ¶
MustResolve is the same as Resolve but panics instead of returning an error.
func (*Type) Resolve ¶
Resolve a tracked offset by allowing it to be committed. The highest possible offset to be committed is returned, or an error if the provided offset was not recognised.