catalogwalk

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0, AGPL-3.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package catalogwalk owns streaming validation of authenticated terminal catalog generations. Callers reduce entries into bounded facts and discard those provisional facts unless the walk returns a complete generation.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidTerminalGenerationWalk = errors.New("terminal catalog generation walk is invalid")
	ErrTerminalGenerationIntegrity   = errors.New("terminal catalog generation failed integrity validation")
)

Functions

This section is empty.

Types

type BudgetLimit

type BudgetLimit uint8

BudgetLimit identifies the local resource dimension that stopped a walk. Exhaustion is proof inability, not catalog corruption.

const (
	BudgetWithinLimits BudgetLimit = iota
	BudgetAuthenticatedPages
	BudgetEntries
	BudgetAuthenticatedMetadata
)

func (BudgetLimit) Valid

func (limit BudgetLimit) Valid() bool

type Limits

type Limits struct {
	// contains filtered or unexported fields
}

Limits bounds aggregate accepted work across any number of directory walks.

func NewLimits

func NewLimits(authenticatedPages, entries uint32, authenticatedMetadata uint64) (Limits, bool)

type Meter

type Meter struct {
	// contains filtered or unexported fields
}

Meter applies one aggregate limit across a multi-directory proof.

func NewMeter

func NewMeter(limits Limits) (*Meter, bool)

func (*Meter) Usage

func (meter *Meter) Usage() Usage

type TerminalGeneration

type TerminalGeneration struct {
	Directory catalog.CommittedDirectory

	Validated bool
	Exhausted BudgetLimit
	// contains filtered or unexported fields
}

TerminalGeneration is usable proof only when Validated is true. Source exclusions do not invalidate the authenticated catalog or its terminal page.

func ReadTerminalGeneration

func ReadTerminalGeneration(
	ctx context.Context,
	cursor catalog.DirectoryPageCursor,
	expectedShare catalog.ShareInstance,
	expectedDirectory catalog.DirectoryID,
	meter *Meter,
	visit func(catalog.Entry) error,
) (result TerminalGeneration, resultErr error)

ReadTerminalGeneration validates one forward-only generation against its expected authenticated scope. visit must only update disposable, bounded reducer state: entries remain provisional until this function returns a complete generation.

func (TerminalGeneration) PageCommitments

func (generation TerminalGeneration) PageCommitments() []catalog.PageCommitment

PageCommitments returns the authenticated chain needed to replay the same generation without exposing mutable walker state.

type Usage

type Usage struct {
	AuthenticatedPages         uint32
	Entries                    uint32
	AuthenticatedMetadataBytes uint64
}

Usage reports only pages accepted into semantic validation. A page that crosses a local bound is released by the cursor without becoming proof input; metadata bytes charge its bounded decoded catalog representation.

Jump to

Keyboard shortcuts

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