| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Boot
Description
The shared boot environment owns the process logger and telemetry resources. Role work ends
before these resources drain and close. ecluse check-config (Ecluse.CheckConfig) reuses the
configuration prologue and the runtime-knob projection here, so the two entry points cannot
disagree about what a start-up reads or refuses.
Synopsis
- data BootEnv = BootEnv {
- beConfig :: Config
- beLogEnv :: LogEnv
- beTelemetry :: Telemetry
- beBootPlan :: BootPlan
- withBootEnv :: BootRole -> (BootEnv -> IO a) -> IO a
- loadBootConfig :: (Text -> Text) -> IO ([(String, String)], Maybe ByteString, Config)
- applySecretFileIndirection :: [(String, String)] -> IO (Either Text [(String, String)])
- readConfigDocument :: [(String, String)] -> IO (Either Text (Maybe ByteString))
- runtimeOverridesOf :: RuntimeSettings -> RuntimeOverrides
- newtype BootAborted = BootAborted Text
- orExit :: (e -> Text) -> Either e a -> IO a
- refuseBoot :: Text -> IO a
- logBootWarning :: LogEnv -> Text -> IO ()
- logBootInfo :: LogEnv -> Text -> IO ()
- logRuleBootOrder :: LogEnv -> [MountBinding] -> IO ()
- buildMirrorQueue :: LogEnv -> Int -> MirrorQueuePlan -> IO MirrorQueue
- applyServerSettings :: ServerSettings -> ServerConfig -> ServerConfig
- probeServerConfig :: AppConfig -> ServerConfig
The boot environment
Configuration and process resources borrowed by a running role.
Constructors
| BootEnv | |
Fields
| |
withBootEnv :: BootRole -> (BootEnv -> IO a) -> IO a Source #
Drain the process logger after role work and telemetry cleanup, on normal or exceptional exit.
The configuration prologue
loadBootConfig :: (Text -> Text) -> IO ([(String, String)], Maybe ByteString, Config) Source #
The environment, the secret files it names, the config document, and the parse, in that order.
decorate wraps each refusal, which is how ecluse check-config adds its own verdict line.
applySecretFileIndirection :: [(String, String)] -> IO (Either Text [(String, String)]) Source #
Resolve secret files, strip trailing newlines, and refuse conflicting direct values.
readConfigDocument :: [(String, String)] -> IO (Either Text (Maybe ByteString)) Source #
Accept a missing default document, but refuse an explicit path that does not exist.
runtimeOverridesOf :: RuntimeSettings -> RuntimeOverrides Source #
Project the configured runtime knobs onto the posture the RTS applies.
Refusal
newtype BootAborted Source #
A start-up refusal that the process perimeter reports before exiting.
Constructors
| BootAborted Text |
Instances
| Exception BootAborted Source # | |
Defined in Ecluse.Boot Methods toException :: BootAborted -> SomeException # fromException :: SomeException -> Maybe BootAborted # displayException :: BootAborted -> String # backtraceDesired :: BootAborted -> Bool # | |
| Show BootAborted Source # | |
Defined in Ecluse.Boot Methods showsPrec :: Int -> BootAborted -> ShowS # show :: BootAborted -> String # showList :: [BootAborted] -> ShowS # | |
| Eq BootAborted Source # | |
Defined in Ecluse.Boot | |
orExit :: (e -> Text) -> Either e a -> IO a Source #
Abort on a rendered refusal, or return the successful result.
refuseBoot :: Text -> IO a Source #
Raise the complete refusal for the process perimeter to report.
Boot-time logging and wiring
logBootWarning :: LogEnv -> Text -> IO () Source #
Report a boot warning under the root module's logging context.
logBootInfo :: LogEnv -> Text -> IO () Source #
Report a boot diagnostic under the root module's logging context.
logRuleBootOrder :: LogEnv -> [MountBinding] -> IO () Source #
Report evaluation order for each wired mount.
buildMirrorQueue :: LogEnv -> Int -> MirrorQueuePlan -> IO MirrorQueue Source #
Build the planned queue and log its durability and delivery-limit warnings.
applyServerSettings :: ServerSettings -> ServerConfig -> ServerConfig Source #
Apply the shared listener settings without replacing role hooks or the launch's drain signal.
probeServerConfig :: AppConfig -> ServerConfig Source #
Serve health probes with the shared listener settings and no package mounts.