| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Registry.Metadata.Fetch.Types
Description
The read driver's shared vocabulary: what an ecosystem supplies, where a read's bytes come from, and what a read is held to. The ecosystem modules and the body sources build these values, Ecluse.Core.Registry.Adapter.Capability holds each ecosystem's, and Ecluse.Core.Registry.Metadata.Fetch runs them.
Synopsis
- data EcosystemRead = EcosystemRead {
- erRequest :: BaseRequest -> Maybe ClientCredential -> PackageName -> Either UrlFormationError Request
- erUniqueFields :: [Text]
- erWalkFull :: Limits -> PackageName -> Text -> DocumentWalk full
- erFinishFull :: Limits -> PackageName -> Text -> StreamResult full -> Either MetadataError (PackageInfo, CachedDoc)
- erRetainedEntries :: full -> RetainedEntries
- erWalkSelected :: Limits -> PackageName -> Version -> DocumentWalk selected
- erFinishSelected :: Limits -> PackageName -> Text -> Version -> StreamResult selected -> Either MetadataError VersionRead
- type DocumentWalk s = BodyLimit -> InternTable -> IO ByteString -> IO (Either LimitError (StreamResult s))
- newtype Body = Body (forall a. (IO ByteString -> IO (Either LimitError a)) -> IO (Either FetchFault (BodyOutcome a)))
- data ReadTerms = ReadTerms {}
- type ManifestFetch = TracingPort -> OriginClient -> PackageName -> IO (Either MetadataError Manifest)
What an ecosystem supplies
data EcosystemRead Source #
What differs between ecosystems in a metadata read. The two type variables are its walks' results, hidden so that one adapter field holds any ecosystem's reads.
Constructors
| EcosystemRead | |
Fields
| |
type DocumentWalk s = BodyLimit -> InternTable -> IO ByteString -> IO (Either LimitError (StreamResult s)) Source #
One walk of a body's chunks. The driver hands it the metadata body limit and a table keyed afresh for the read, and the walk applies both.
What a read runs over
Where a read's bytes come from. It runs a consumer over the chunks while the body is open, and reports how the exchange went. A response is one such body, and bytes already held are another.
Constructors
| Body (forall a. (IO ByteString -> IO (Either LimitError a)) -> IO (Either FetchFault (BodyOutcome a))) |
What a read is held to and what it pays, whatever body it reads.
A fetch from an origin
type ManifestFetch = TracingPort -> OriginClient -> PackageName -> IO (Either MetadataError Manifest) Source #
Fetching and projecting one package's full manifest from an origin. Every failure is a
MetadataError value, as it is through the client built over it.