Copyright | (c) 2019-2022 Vaclav Svejcar |
---|---|
License | BSD-3-Clause |
Maintainer | vaclav.svejcar@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Logic for running shared code and bootstrapping all Headroom command RIO applications.
Synopsis
- data BootstrapEnv = BootstrapEnv {}
- bootstrap :: (HasRIO FileSystem env, HasRIO KVStore env, HasRIO Network env, HasLogFunc env) => RIO env BootstrapEnv
- runRIO' :: (LogFunc -> IO env) -> Bool -> RIO env a -> IO a
- globalKVStore :: HasRIO FileSystem env => RIO env (KVStore (RIO env))
Documentation
data BootstrapEnv Source #
Bootstrap environment, containing pieces shared between all commands.
BootstrapEnv | |
|
bootstrap :: (HasRIO FileSystem env, HasRIO KVStore env, HasRIO Network env, HasLogFunc env) => RIO env BootstrapEnv Source #
Executes the initialization logic that should be performed before any other code is executed. During this bootstrap, for example global configuration is initialized and loaded, welcome message is printed to console and updates are checked.
:: (LogFunc -> IO env) | function returning environment data |
-> Bool | whether to run in debug mode |
-> RIO env a | RIO application to execute |
-> IO a | execution result |
Runs RIO application using provided environment data and flag whether to run in debug mode.
globalKVStore :: HasRIO FileSystem env => RIO env (KVStore (RIO env)) Source #
Shared SQLite-based KVStore
.