| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Registry.Adapter
Description
The ecosystem adapter registry: resolve an Ecosystem to its registered
capability record.
The registry is the build's answer to "which ecosystems does this binary support?", independent of anything an operator configures. That keeps three situations distinct and legible:
- an ecosystem the build does not support resolves to
Nothinghere; - a supported ecosystem with no mount configured is simply not activated -- no error, nothing served under its prefix;
- a configured ecosystem that resolves to
Nothingis the composition root's loud missing-adapter boot error, never a half-wired mount.
adapterFor is a total case over the closed Ecosystem sum with an explicit arm
per constructor, so supporting a new ecosystem is additive: it brings its own
adapter module (npm's is Ecluse.Core.Registry.Npm.Adapter) and gains an arm
here, touching neither another ecosystem's code nor the core engine. The adapter
is consumed only at the composition root, which resolves it once per activation
and projects each consuming pipeline's dependency record from its fields; the
pipelines never import this module.
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
- adapterFor :: Ecosystem -> Maybe RegistryAdapter
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
| |
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
| |
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
| |
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
| |
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
| |
Registration
adapterFor :: Ecosystem -> Maybe RegistryAdapter Source #
Resolve an ecosystem to its registered RegistryAdapter, or Nothing for
one this build carries no adapter for. Total over the closed Ecosystem sum,
every arm explicit, so an added ecosystem is a compiler-visible arm here rather
than a fall-through.