validation

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateSegmentsForFile

func ValidateSegmentsForFile(
	ctx context.Context,
	filename string,
	fileSize int64,
	segments []*metapb.SegmentData,
	encryption metapb.Encryption,
	poolManager pool.Manager,
	maxGoroutines int,
	samplePercentage int,
	progressTracker progress.ProgressTracker,
	timeout time.Duration,
) error

ValidateSegmentsForFile performs comprehensive validation of file segments including size verification and reachability checks. It validates that segments are structurally sound, accessible via the Usenet connection pool, and that their total size matches the expected file size (accounting for encryption overhead).

The function uses a single combined pass for structural validation + size accumulation + segment selection, then validates only the selected subset via the network. This avoids iterating the full segment list twice (once here and once inside ValidateSegmentAvailability).

The optional progressTracker is passed through to segment availability validation for real-time progress updates during concurrent validation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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