Documentation ¶
Overview ¶
Package cpaccessor contains methods to access streams with checkpointing conception.
Index ¶
- type CheckpointingAccessor
- func (a *CheckpointingAccessor[T]) Commit()
- func (a *CheckpointingAccessor[T]) Next() T
- func (a *CheckpointingAccessor[T]) Reset()
- func (a *CheckpointingAccessor[T]) Rollback() T
- func (a *CheckpointingAccessor[T]) SetCheckpoint()
- func (a *CheckpointingAccessor[T]) SetStream(stream ResourceStream[T])
- type ResourceStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckpointingAccessor ¶
type CheckpointingAccessor[T any] struct { // contains filtered or unexported fields }
CheckpointingAccessor is used to access stream with checkpoints.
func NewCheckpointingAccessor ¶
func NewCheckpointingAccessor[T any]() CheckpointingAccessor[T]
func (*CheckpointingAccessor[T]) Commit ¶
func (a *CheckpointingAccessor[T]) Commit()
Commit marks the latest checkpoint as successful and removes it. Further Rollback calls will not return accessor to this checkpoint.
func (*CheckpointingAccessor[T]) Next ¶
func (a *CheckpointingAccessor[T]) Next() T
Next moves accessor to the next element in the stream.
func (*CheckpointingAccessor[T]) Reset ¶
func (a *CheckpointingAccessor[T]) Reset()
func (*CheckpointingAccessor[T]) Rollback ¶
func (a *CheckpointingAccessor[T]) Rollback() T
Rollback moves accessor to the latest uncommited checkpoint and removes checkpoint. Returned value - is the last element before checkpoint set.
func (*CheckpointingAccessor[T]) SetCheckpoint ¶
func (a *CheckpointingAccessor[T]) SetCheckpoint()
SetCheckpoint sets checkpoint at current position in the stream.
func (*CheckpointingAccessor[T]) SetStream ¶
func (a *CheckpointingAccessor[T]) SetStream(stream ResourceStream[T])
type ResourceStream ¶
type ResourceStream[T any] interface { Next() T }
ResourceStream represents an underlying stream for accessing elements.
Click to show internal directories.
Click to hide internal directories.