| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Composition
Description
Bind validated mounts and publication targets without origin discovery. Live wiring prepares rule state and the credentials required by each role.
Synopsis
- type ResolveAdapter = Ecosystem -> PackumentDeps -> Maybe PublishDeps -> Maybe MountBinding
- data WiringPorts = WiringPorts {
- wpReporters :: Ecosystem -> StoreTag -> CredentialReporters
- wpBuildCredentials :: BuildCredentials
- wpResolveAdapter :: ResolveAdapter
- wpClock :: IO UTCTime
- wpRuleDeps :: Ecosystem -> RuleDeps
- data BootWiring = BootWiring {
- bwBindings :: [MountBinding]
- bwPublishTargets :: [PublishTarget]
- resolveBootWiring :: WiringPorts -> MirrorMintPlan -> Limits -> Maybe PublishBudget -> ValidatedPlan -> IO (Either [BootError] BootWiring)
- planMounts :: ResolveAdapter -> IO UTCTime -> (Ecosystem -> RuleDeps) -> MirrorMintPlan -> CredentialProviders -> Limits -> Maybe PublishBudget -> ValidatedPlan -> IO (Either [BootError] [MountBinding])
- data PublishBudget = PublishBudget {
- pbBodyBudget :: ByteAdmission
- pbMaxRequestBytes :: Int
- data PublishTarget = PublishTarget {
- ptEcosystem :: Ecosystem
- ptMirrorUrl :: RegistryUrl
- ptUploadUrl :: RegistryUrl
- ptPresentation :: ServicePresentation
- ptUsername :: Maybe Text
- ptCredentials :: CredentialProvider
- planPublishTargets :: MirrorMintPlan -> CredentialProviders -> ValidatedPlan -> Either [BootError] [PublishTarget]
The environment-dependent wiring
type ResolveAdapter = Ecosystem -> PackumentDeps -> Maybe PublishDeps -> Maybe MountBinding Source #
Resolve an ecosystem's deps to its mount, Nothing without an adapter. Ecluse.Service implements it.
data WiringPorts Source #
The capabilities the wiring is built through, injected so a unit test assembles it with no listener.
Constructors
| WiringPorts | |
Fields
| |
data BootWiring Source #
What only a live environment settles: the served mounts and the worker's publish targets.
Constructors
| BootWiring | |
Fields
| |
resolveBootWiring :: WiringPorts -> MirrorMintPlan -> Limits -> Maybe PublishBudget -> ValidatedPlan -> IO (Either [BootError] BootWiring) Source #
Resolve serving mounts and worker targets from the same credential providers.
Boot-time wiring
planMounts :: ResolveAdapter -> IO UTCTime -> (Ecosystem -> RuleDeps) -> MirrorMintPlan -> CredentialProviders -> Limits -> Maybe PublishBudget -> ValidatedPlan -> IO (Either [BootError] [MountBinding]) Source #
Resolve mounts with their configured authority and publication budget.
Publish-side wiring
data PublishBudget Source #
The publish byte discipline, aggregate admission and per-request cap, present exactly when a mount publishes.
Constructors
| PublishBudget | |
Fields
| |
data PublishTarget Source #
One ecosystem's publish target, resolved once: the worker's write endpoint and its token provider.
Constructors
| PublishTarget | |
Fields
| |
planPublishTargets :: MirrorMintPlan -> CredentialProviders -> ValidatedPlan -> Either [BootError] [PublishTarget] Source #
Each cleared mount's publish target, or the aggregated boot errors. A role that mints no write credential plans none.