ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry.PyPI.StreamingProjection

Description

Join supported PyPI fields while preserving source positions and existing read limits.

Synopsis

Documentation

data PyPIProjection Source #

Pending files wait for the reported name so member order cannot change the package identity.

emptyProjection :: PackageName -> PyPIProjection Source #

Start one project's source without retaining any input chunks.

collectField :: Limits -> PyPIProjection -> PyPIField -> Either LimitError PyPIProjection Source #

Take one field. A file refuses the read at the first file position past the version ceiling.

keepsFile :: PyPIProjection -> Bool Source #

Whether a file read now would be retained: files in the first files array.

claimsEnvelope :: PyPIProjection -> Text -> Bool Source #

Whether the envelope holds an earlier occurrence of the key, so the walk drops a repeat as it reads it.

retainedEntries :: PyPIProjection -> RetainedEntries Source #

The files and file drops, and the version drops and envelope array items, the projection holds.

finishProjection :: PackageName -> PyPIProjection -> Either MetadataError (PackageInfo, SimpleDocument) Source #

Check protocol, name and shape, then project the source's retained files.

packedFileStep :: Writer st -> Limits -> PyPIProjection -> Int -> FileValue -> (Either LimitError PyPIProjection -> ST st r) -> ST st r Source #

Refuse at the first file position past the version ceiling. Decode a whole file only for its invalid-entry diagnostic.

finishPackedProjection :: PackageName -> DocTable -> PyPIProjection -> Either MetadataError (PackageInfo, PackedSimple) Source #

Bind the reported name after reading, and retain serving files against the sealed table.