| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Shrun.Configuration.Env.Types
Description
Provides types and typeclasses for our environment.
Synopsis
- class HasCommands env where
- getCleanup :: env -> Maybe CommandCleanup
- getCommandDepGraph :: env -> CommandGraph
- getCommandStatusMap :: env -> TCommandStatusMap
- data CommandCleanup = MkCommandCleanup {}
- updateCommandStatus :: (HasCallStack, HasCommands env, MonadAtomic m, MonadReader env m, MonadThrow m) => CommandP1 -> CommandStatus -> m ()
- getReadCommandStatus :: (HasCallStack, HasCommands env, MonadAtomic m, MonadReader env m) => m CommandStatusMap
- class HasCommandLogging env where
- getCommandLogging :: env -> CommandLoggingEnv
- class HasCommonLogging env where
- getCommonLogging :: env -> CommonLoggingEnv
- class HasConsoleLogging env r where
- getConsoleLogging :: env -> (ConsoleLoggingEnv, TBQueue (LogRegion r), IORef (Maybe r))
- class HasFileLogging env where
- getFileLogging :: env -> Maybe FileLoggingEnv
- class HasTimeout env where
- getTimeout :: env -> WithDisabled Timeout
- getHasTimedOut :: env -> TVar Bool
- setTimedOut :: (HasTimeout env, MonadAtomic m, MonadReader env m) => m ()
- whenTimedOut :: (HasTimeout env, MonadAtomic m, MonadReader env m) => m () -> m ()
- class HasInit env where
- class HasAnyError env where
- getAnyError :: env -> TVar Bool
- setAnyErrorTrue :: (HasAnyError env, HasCallStack, MonadAtomic m, MonadReader env m) => m ()
- class HasNotifyConfig env r where
- getNotifyConfig :: env -> Maybe (NotificationEnv r)
- type HasLogging env (m :: Type -> Type) = (HasCommandLogging env, HasCommonLogging env, HasConsoleLogging env (Region m), HasFileLogging env)
- data Env notifyEnv logRegion = MkEnv {
- anyError :: TVar Bool
- commandCleanup :: Maybe CommandCleanup
- commands :: NESeq CommandP1
- commandGraph :: CommandGraph
- commandStatusMap :: TCommandStatusMap
- config :: CoreConfigP 'ConfigPhaseEnv notifyEnv
- consoleLogQueue :: ~(TBQueue (LogRegion logRegion))
- hasTimedOut :: TVar Bool
- timerRegion :: IORef (Maybe logRegion)
- whenDebug :: (HasCommonLogging env, MonadReader env m) => m () -> m ()
"HasX" style typeclasses
class HasCommands env where Source #
The commands themselves.
Methods
getCleanup :: env -> Maybe CommandCleanup Source #
Retrieves the cleanup functions, if they exist.
getCommandDepGraph :: env -> CommandGraph Source #
Retrieves full command graph.
getCommandStatusMap :: env -> TCommandStatusMap Source #
Retrieves commands and their statuses.
Instances
| HasCommands (Env m r) Source # | |
Defined in Shrun.Configuration.Env.Types Methods getCleanup :: Env m r -> Maybe CommandCleanup Source # getCommandDepGraph :: Env m r -> CommandGraph Source # getCommandStatusMap :: Env m r -> TCommandStatusMap Source # | |
data CommandCleanup Source #
Constructors
| MkCommandCleanup | |
Fields | |
Instances
| Show CommandCleanup Source # | |
Defined in Shrun.Configuration.Env.Types Methods showsPrec :: Int -> CommandCleanup -> ShowS # show :: CommandCleanup -> String # showList :: [CommandCleanup] -> ShowS # | |
| Eq CommandCleanup Source # | |
Defined in Shrun.Configuration.Env.Types Methods (==) :: CommandCleanup -> CommandCleanup -> Bool # (/=) :: CommandCleanup -> CommandCleanup -> Bool # | |
| (k ~ A_Lens, a ~ FilePath, b ~ FilePath) => LabelOptic "findPidsExe" k CommandCleanup CommandCleanup a b Source # | |
Defined in Shrun.Configuration.Env.Types Methods labelOptic :: Optic k NoIx CommandCleanup CommandCleanup a b Source # | |
| (k ~ A_Lens, a ~ FilePath, b ~ FilePath) => LabelOptic "killPidsExe" k CommandCleanup CommandCleanup a b Source # | |
Defined in Shrun.Configuration.Env.Types Methods labelOptic :: Optic k NoIx CommandCleanup CommandCleanup a b Source # | |
updateCommandStatus :: (HasCallStack, HasCommands env, MonadAtomic m, MonadReader env m, MonadThrow m) => CommandP1 -> CommandStatus -> m () Source #
Prepends a completed command.
getReadCommandStatus :: (HasCallStack, HasCommands env, MonadAtomic m, MonadReader env m) => m CommandStatusMap Source #
Retrieves the entire status map in a single STM transaction.
class HasCommandLogging env where Source #
Methods
getCommandLogging :: env -> CommandLoggingEnv Source #
Instances
| HasCommandLogging (Env m r) Source # | |
Defined in Shrun.Configuration.Env.Types Methods getCommandLogging :: Env m r -> CommandLoggingEnv Source # | |
class HasCommonLogging env where Source #
Methods
getCommonLogging :: env -> CommonLoggingEnv Source #
Instances
| HasCommonLogging (Env m r) Source # | |
Defined in Shrun.Configuration.Env.Types Methods getCommonLogging :: Env m r -> CommonLoggingEnv Source # | |
class HasConsoleLogging env r where Source #
Methods
getConsoleLogging :: env -> (ConsoleLoggingEnv, TBQueue (LogRegion r), IORef (Maybe r)) Source #
Instances
| HasConsoleLogging (Env m r) r Source # | |
Defined in Shrun.Configuration.Env.Types Methods getConsoleLogging :: Env m r -> (ConsoleLoggingEnv, TBQueue (LogRegion r), IORef (Maybe r)) Source # | |
class HasFileLogging env where Source #
Methods
getFileLogging :: env -> Maybe FileLoggingEnv Source #
Instances
| HasFileLogging (Env m r) Source # | |
Defined in Shrun.Configuration.Env.Types Methods getFileLogging :: Env m r -> Maybe FileLoggingEnv Source # | |
class HasTimeout env where Source #
Timeout, if any.
Methods
getTimeout :: env -> WithDisabled Timeout Source #
getHasTimedOut :: env -> TVar Bool Source #
Instances
| HasTimeout (Env m r) Source # | |
Defined in Shrun.Configuration.Env.Types Methods getTimeout :: Env m r -> WithDisabled Timeout Source # | |
setTimedOut :: (HasTimeout env, MonadAtomic m, MonadReader env m) => m () Source #
Sets timedout to true.
whenTimedOut :: (HasTimeout env, MonadAtomic m, MonadReader env m) => m () -> m () Source #
Run the action when shrun has timed out.
class HasAnyError env where Source #
Instances
| HasAnyError (Env m r) Source # | |
Defined in Shrun.Configuration.Env.Types | |
setAnyErrorTrue :: (HasAnyError env, HasCallStack, MonadAtomic m, MonadReader env m) => m () Source #
Set anyError to True.
class HasNotifyConfig env r where Source #
Class for retrieving the notify config.
Instances
| HasNotifyConfig (Env notifyEnv r) notifyEnv Source # | |
Defined in Shrun.Configuration.Env.Types Methods getNotifyConfig :: Env notifyEnv r -> Maybe (NotificationEnv notifyEnv) Source # | |
Aggregate
type HasLogging env (m :: Type -> Type) = (HasCommandLogging env, HasCommonLogging env, HasConsoleLogging env (Region m), HasFileLogging env) Source #
Alias for all logging config.
Types
data Env notifyEnv logRegion Source #
The main Env type used by Shrun.
Constructors
| MkEnv | |
Fields
| |
Instances
whenDebug :: (HasCommonLogging env, MonadReader env m) => m () -> m () Source #
Run the action when the debug flag is active.