| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Registry.Adapter.Types
Description
The vocabulary of the ecosystem adapter registry: the capability record an
ecosystem registers (RegistryAdapter) and its four cohesive slices.
A RegistryAdapter captures what an ecosystem is -- a static fact of the
build, independent of anything an operator configures: how its request paths classify
and respond (the serve surface), how its metadata is read and
assembled, how its artifact requests are formed, and how a publish reaches a
registry. Which ecosystems are active is configuration's fact, not this
record's: nothing here holds a URL, a credential, a limit, or a policy. Those
arrive as arguments when the composition root projects a consuming pipeline's
dependency record (PackumentDeps,
PublishDeps, the worker runtime's fetch wiring) from
an adapter's fields. The pipelines keep their own records and never read this one,
so an adapter is resolved at boot and never rides the hot path.
The record vocabulary lives apart from the registration
(Ecluse.Core.Registry.Adapter) so an ecosystem's adapter module can type its
record without importing the registry, which must import every adapter -- the
cycle-breaking .Types extraction STYLE.md sanctions.
Synopsis
- data RegistryAdapter = RegistryAdapter {}
- data AdapterServe = AdapterServe {}
- data AdapterMetadata = AdapterMetadata {
- metadataNewClient :: TracingPort -> MetricsPort -> Upstream -> ManifestCaching -> (PackageName -> MetadataError -> IO ()) -> (PackageName -> [InvalidEntry] -> IO ()) -> (PackageName -> IO ()) -> Limits -> Manager -> Text -> Maybe Secret -> MetadataClient
- metadataAssemble :: Text -> Map SourceId CachedDoc -> MergePlan -> Maybe CachedDoc -> CachedDoc
- metadataSerialise :: CachedDoc -> LByteString
- data AdapterArtifact = AdapterArtifact {
- artifactByFile :: Limits -> Manager -> Text -> Maybe Secret -> PackageName -> Text -> Either UrlFormationError Request
- artifactByUrl :: Limits -> Manager -> Text -> Maybe Secret -> Text -> Either UrlFormationError Request
- artifactHosts :: [Text]
- data AdapterPublish = AdapterPublish {
- publishRelay :: Limits -> Manager -> Text -> Maybe Secret -> PackageName -> ByteString -> IO (Either PublishRelayFault PublishRelayResponse)
- publishCanonicaliseName :: Text -> Maybe PackageName
- publishDeclaredNames :: LByteString -> [Text]
- publishCodec :: PublishCodec
The capability record
data RegistryAdapter Source #
One ecosystem's complete capability record: the interfaces every consuming
pipeline's wiring is projected from. Assembled once per ecosystem (npm's is
npmAdapter) and resolved through
adapterFor.
Constructors
| RegistryAdapter | |
Fields
| |
The serve surface
data AdapterServe Source #
The ecosystem's web-facing serve surface: the one slice of the record that is about HTTP shape rather than registry protocol, typed against the agnostic action and response vocabulary (Ecluse.Core.Server.Context, Ecluse.Core.Server.Response) because it is web-facing by definition (the registry-to-server import direction is deliberate here). Serve surfaces are where ecosystems diverge most, so this slice stands alone rather than sharing shape with the protocol slices.
Both routing fields are derived by the adapter from one declarative route table (npm's is Ecluse.Core.Registry.Npm.Route), so the surface the server routes and the surface the manifest documents are two interpretations of a single declaration and cannot drift apart.
Constructors
| AdapterServe | |
Fields
| |
Metadata
data AdapterMetadata Source #
The ecosystem's metadata capability: how a package's metadata is read from an
origin and how a served document is assembled. The fields have exactly the shapes
the consuming dependency records carry
(pdNewMetadataClient and
pdAssemble), so the composition root projects them
unchanged and registering an adapter cannot reshape a pipeline.
Constructors
| AdapterMetadata | |
Fields
| |
Artifact requests
data AdapterArtifact Source #
The ecosystem's artifact request formation: the two ways an artifact is
addressed, by conventional filename under a registry base and by its authoritative
upstream URL. The fields have exactly the shapes the consuming dependency records
carry (pdBuildArtifactRequestByFile and
pdBuildArtifactRequestByUrl).
Constructors
| AdapterArtifact | |
Fields
| |
Publish
data AdapterPublish Source #
The ecosystem's publish capability: relaying a client's own publish document,
canonicalising a raw package name, extracting the names a publish body declares, and
the mirror-write protocol codec. The relay, canonicaliser, and declared-name extractor
have exactly the shapes the consuming dependency record carries
(pubRelayPublish,
pubCanonicaliseName, and
pubDeclaredNames); the codec is the protocol half
of the mirror write, which the composition root marries to the shared publish
transport per mounted ecosystem (newMirrorPublish).
Constructors
| AdapterPublish | |
Fields
| |