ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

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

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

newtype Body Source #

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))) 

data ReadTerms Source #

What a read is held to and what it pays, whatever body it reads.

Constructors

ReadTerms 

Fields

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.