ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Registry.Metadata

Description

The per-request metadata handle and typed outcomes shared by registry adapters. HTTP refusals retain their cause before projection. The serve pipeline owns fallback policy.

Synopsis

The read handle

data MetadataClient Source #

Per-origin metadata operations with typed failures and caller-selected caching.

Constructors

MetadataClient 

Fields

The full-manifest result

data Manifest Source #

A package snapshot with ecosystem-owned serving data and the original source digest.

Constructors

Manifest 

Fields

digestBytes :: ContentDigest -> ByteString Source #

The digest's raw 32 bytes, for feeding into a wider fingerprint.

One version's read

data VersionDoc Source #

One version's typed projection paired with the object the source declared it with, built once from one body and never re-paired, so the mirror write republishes what the rules admitted.

Constructors

VersionDoc 

Fields

Instances

Instances details
Show VersionDoc Source # 
Instance details

Defined in Ecluse.Core.Registry.Metadata

Eq VersionDoc Source # 
Instance details

Defined in Ecluse.Core.Registry.Metadata

data VersionRead Source #

The requested version and the latest tag the same document declared. Both come from one bounded read, so a caller needing the tag adds no second fetch.

Constructors

VersionRead 

Fields

Instances

Instances details
Show VersionRead Source # 
Instance details

Defined in Ecluse.Core.Registry.Metadata

Eq VersionRead Source # 
Instance details

Defined in Ecluse.Core.Registry.Metadata

Errors

data MetadataError Source #

Why a metadata fetch could not yield a usable result.

Constructors

MetadataAuthorisationFailure Int

The upstream explicitly refused access. Carries the original 401 or 403.

MetadataAbsent

The upstream answered 404. Its body cannot establish a package's identity.

MetadataHttpFailure Int

Another non-success HTTP status, retained for the consumer's retry policy.

MetadataFetch FetchFault

A failed exchange, with request-formation, bound, and transport causes kept distinct.

MetadataBoundExceeded LimitError

The decoded structure crossed a limit, distinct from an exchange body-size failure.

MetadataUndecodable

Malformed bytes or a missing package identity prevented manifest decoding.

MetadataNameMismatch Text

An invalid package identity, carried for diagnostics and excluded from the requested package.

metadataResponse :: Either FetchFault (BodyOutcome a) -> Either MetadataError a Source #

Classify a metadata exchange. A 404 cannot establish identity, and a refusal keeps its status.

Single-version resolution

data VersionEvaluation Source #

A version lookup result shared by public admission and mirror workers.

Constructors

VersionPresent VersionDoc (Maybe Version)

The version resolved and projected. The second field is the same document's latest.

VersionMissing

The package exists but does not supply the requested version.

VersionMetadataUnavailable

Metadata was unavailable. Public admission and workers retain their retry policy.

fetchVersionDetails :: MetadataClient -> PackageName -> Version -> IO VersionEvaluation Source #

Classify a version lookup for public admission and workers, treating metadata failures as transient.

versionEvaluation :: Either MetadataError VersionRead -> VersionEvaluation Source #

Classify a resolved selected read without changing its acquisition lifetime.

versionTransience :: VersionEvaluation -> Maybe Transience Source #

Classify unsuccessful lookups for retry. A resolved version has no transience.