| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
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
- data MetadataClient = MetadataClient {}
- data Manifest = Manifest {}
- data ContentDigest
- digestBytes :: ContentDigest -> ByteString
- data VersionDoc = VersionDoc {}
- data VersionRead = VersionRead {}
- data MetadataError
- metadataResponse :: Either FetchFault (BodyOutcome a) -> Either MetadataError a
- data VersionEvaluation
- fetchVersionDetails :: MetadataClient -> PackageName -> Version -> IO VersionEvaluation
- versionEvaluation :: Either MetadataError VersionRead -> VersionEvaluation
- versionTransience :: VersionEvaluation -> Maybe Transience
The read handle
data MetadataClient Source #
Per-origin metadata operations with typed failures and caller-selected caching.
Constructors
| MetadataClient | |
Fields
| |
The full-manifest result
A package snapshot with ecosystem-owned serving data and the original source digest.
Constructors
| Manifest | |
Fields
| |
data ContentDigest Source #
Fingerprint the exact upstream bytes used to build a manifest.
Instances
| Show ContentDigest Source # | |
Defined in Ecluse.Core.Snapshot Methods showsPrec :: Int -> ContentDigest -> ShowS # show :: ContentDigest -> String # showList :: [ContentDigest] -> ShowS # | |
| Eq ContentDigest Source # | |
Defined in Ecluse.Core.Snapshot Methods (==) :: ContentDigest -> ContentDigest -> Bool # (/=) :: ContentDigest -> ContentDigest -> Bool # | |
| Ord ContentDigest Source # | |
Defined in Ecluse.Core.Snapshot Methods compare :: ContentDigest -> ContentDigest -> Ordering # (<) :: ContentDigest -> ContentDigest -> Bool # (<=) :: ContentDigest -> ContentDigest -> Bool # (>) :: ContentDigest -> ContentDigest -> Bool # (>=) :: ContentDigest -> ContentDigest -> Bool # max :: ContentDigest -> ContentDigest -> ContentDigest # min :: ContentDigest -> ContentDigest -> ContentDigest # | |
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 | |
Instances
| Show VersionDoc Source # | |
Defined in Ecluse.Core.Registry.Metadata Methods showsPrec :: Int -> VersionDoc -> ShowS # show :: VersionDoc -> String # showList :: [VersionDoc] -> ShowS # | |
| Eq VersionDoc Source # | |
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
| Show VersionRead Source # | |
Defined in Ecluse.Core.Registry.Metadata Methods showsPrec :: Int -> VersionRead -> ShowS # show :: VersionRead -> String # showList :: [VersionRead] -> ShowS # | |
| Eq VersionRead Source # | |
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. |
Instances
| Show MetadataError Source # | |
Defined in Ecluse.Core.Registry.Metadata Methods showsPrec :: Int -> MetadataError -> ShowS # show :: MetadataError -> String # showList :: [MetadataError] -> ShowS # | |
| Eq MetadataError Source # | |
Defined in Ecluse.Core.Registry.Metadata Methods (==) :: MetadataError -> MetadataError -> Bool # (/=) :: MetadataError -> MetadataError -> Bool # | |
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 |
| VersionMissing | The package exists but does not supply the requested version. |
| VersionMetadataUnavailable | Metadata was unavailable. Public admission and workers retain their retry policy. |
Instances
| Show VersionEvaluation Source # | |
Defined in Ecluse.Core.Registry.Metadata Methods showsPrec :: Int -> VersionEvaluation -> ShowS # show :: VersionEvaluation -> String # showList :: [VersionEvaluation] -> ShowS # | |
| Eq VersionEvaluation Source # | |
Defined in Ecluse.Core.Registry.Metadata Methods (==) :: VersionEvaluation -> VersionEvaluation -> Bool # (/=) :: VersionEvaluation -> VersionEvaluation -> Bool # | |
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.