| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Registry.Origin
Description
Everything a registry data plane needs to reach one origin: where it is, what to dial it through, what to present, and what response bound to hold it to. The composition root and the serve pipeline are the only builders, and nothing here is derived or cached.
Synopsis
- data OriginClient = OriginClient {
- ocBaseUrl :: RegistryUrl
- ocManager :: Manager
- ocToken :: Maybe ClientCredential
- ocLimits :: Limits
- ocChargeFullRead :: Int -> IO ()
- originClient :: Limits -> Manager -> RegistryUrl -> Maybe ClientCredential -> OriginClient
- originBaseUrl :: OriginClient -> Text
- data OriginFor posture
- data Public
- data Private
- anonymousOrigin :: Limits -> Manager -> RegistryUrl -> OriginFor Public
- perCallerOrigin :: Limits -> Manager -> RegistryUrl -> Maybe ClientCredential -> OriginFor Private
- originClientOf :: OriginFor posture -> OriginClient
- chargingFullReads :: (Int -> IO ()) -> OriginFor posture -> OriginFor posture
Documentation
data OriginClient Source #
One origin's coordinates, credential posture, and response bound.
Constructors
| OriginClient | |
Fields
| |
originClient :: Limits -> Manager -> RegistryUrl -> Maybe ClientCredential -> OriginClient Source #
One origin from the four things that name it. The bound comes first because a caller usually holds one and reaches several origins under it.
originBaseUrl :: OriginClient -> Text Source #
The origin's base URL as text, which is how every request builder takes it.
Credential posture, carried in the type
data OriginFor posture Source #
An OriginClient whose credential posture its builder fixed. The constructor stays here and
the role annotation below stops coerce retagging one.
anonymousOrigin :: Limits -> Manager -> RegistryUrl -> OriginFor Public Source #
An origin dialled with no credential, so no caller's authorisation scopes what it reads.
perCallerOrigin :: Limits -> Manager -> RegistryUrl -> Maybe ClientCredential -> OriginFor Private Source #
An origin presenting one caller's credential, so what it reads is scoped to that caller.
originClientOf :: OriginFor posture -> OriginClient Source #
The plain record behind a tagged origin, for the operations that take any origin.