Documentation
¶
Overview ¶
Package scan resolves the order and position of a built-in storage scan.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidCursor error = durable.NewStorageRequestError("Invalid storage cursor")
ErrInvalidCursor is the error of a cursor that this backend did not write.
Functions ¶
Types ¶
type CausedError ¶
CausedError is an Error with a message and a cause, as `new Error(message, { cause })` is.
func (*CausedError) Error ¶
func (e *CausedError) Error() string
type Start ¶
type Start struct {
Order durable.ScanOrder
// After is the last ID a previous page returned; HasAfter is false for a scan that starts at the beginning.
After int64
HasAfter bool
}
Start is where a built-in storage scan starts: its order and the last ID a previous page returned.
func StartOf ¶
func StartOf(requested *durable.ScanOrder, cursor durable.Cursor, fallback durable.ScanOrder) (Start, error)
StartOf resolves a scan's order and position. A cursor continues in the order it was created with, whether the query repeats that order or omits it; a different order is an error. A cursor without an order, written before scans had one, continues in the scan's default order. An empty cursor is no cursor: Go callers pass a zero Cursor for the start of a scan.