scan

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package scan resolves the order and position of a built-in storage scan.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidCursor error = durable.NewStorageRequestError("Invalid storage cursor")

ErrInvalidCursor is the error of a cursor that this backend did not write.

Functions

func NextCursor

func NextCursor(id int64, order durable.ScanOrder) durable.Cursor

NextCursor is the continuation of a scan whose last returned item has id.

Types

type CausedError

type CausedError struct {
	Message string
	Cause   error
}

CausedError is an Error with a message and a cause, as `new Error(message, { cause })` is.

func (*CausedError) Error

func (e *CausedError) Error() string

func (*CausedError) Unwrap

func (e *CausedError) Unwrap() error

Unwrap returns the cause.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL