shrun
Safe HaskellNone
LanguageGHC2021

Shrun.Configuration.Env.Types

Description

Provides types and typeclasses for our environment.

Synopsis

"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.

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 #

Instances

Instances details
HasCommandLogging (Env m r) Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

class HasCommonLogging env where Source #

Instances

Instances details
HasCommonLogging (Env m r) Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

class HasConsoleLogging env r where Source #

Instances

Instances details
HasConsoleLogging (Env m r) r Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

class HasFileLogging env where Source #

Instances

Instances details
HasFileLogging (Env m r) Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

class HasTimeout env where Source #

Timeout, if any.

Instances

Instances details
HasTimeout (Env m r) Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

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 HasInit env where Source #

Init, if any.

Methods

getInit :: env -> Maybe Text Source #

Instances

Instances details
HasInit (Env m r) Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

Methods

getInit :: Env m r -> Maybe Text Source #

class HasAnyError env where Source #

Methods

getAnyError :: env -> TVar Bool Source #

Retrieves the anyError flag.

Instances

Instances details
HasAnyError (Env m r) Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

Methods

getAnyError :: Env m r -> TVar Bool Source #

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.

Methods

getNotifyConfig :: env -> Maybe (NotificationEnv r) Source #

Retrieves the notify config.

Instances

Instances details
HasNotifyConfig (Env notifyEnv r) notifyEnv Source # 
Instance details

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

Instances details
(k ~ A_Lens, a ~ TVar Bool, b ~ TVar Bool) => LabelOptic "anyError" k (Env m r) (Env m r) a b Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

Methods

labelOptic :: Optic k NoIx (Env m r) (Env m r) a b Source #

(k ~ A_Lens, a ~ Maybe CommandCleanup, b ~ Maybe CommandCleanup) => LabelOptic "commandCleanup" k (Env m r) (Env m r) a b Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

Methods

labelOptic :: Optic k NoIx (Env m r) (Env m r) a b Source #

(k ~ A_Lens, a ~ CommandGraph, b ~ CommandGraph) => LabelOptic "commandGraph" k (Env m r) (Env m r) a b Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

Methods

labelOptic :: Optic k NoIx (Env m r) (Env m r) a b Source #

(k ~ A_Lens, a ~ TCommandStatusMap, b ~ TCommandStatusMap) => LabelOptic "commandStatusMap" k (Env m r) (Env m r) a b Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

Methods

labelOptic :: Optic k NoIx (Env m r) (Env m r) a b Source #

(k ~ A_Lens, a ~ NESeq CommandP1, b ~ NESeq CommandP1) => LabelOptic "commands" k (Env m r) (Env m r) a b Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

Methods

labelOptic :: Optic k NoIx (Env m r) (Env m r) a b Source #

(k ~ A_Lens, a ~ CoreConfigP 'ConfigPhaseEnv notifyEnv, b ~ CoreConfigP 'ConfigPhaseEnv notifyEnv) => LabelOptic "config" k (Env notifyEnv r) (Env notifyEnv r) a b Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

Methods

labelOptic :: Optic k NoIx (Env notifyEnv r) (Env notifyEnv r) a b Source #

(k ~ A_Lens, a ~ TBQueue (LogRegion r), b ~ TBQueue (LogRegion r)) => LabelOptic "consoleLogQueue" k (Env m r) (Env m r) a b Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

Methods

labelOptic :: Optic k NoIx (Env m r) (Env m r) a b Source #

(k ~ A_Lens, a ~ TVar Bool, b ~ TVar Bool) => LabelOptic "hasTimedOut" k (Env m r) (Env m r) a b Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

Methods

labelOptic :: Optic k NoIx (Env m r) (Env m r) a b Source #

(k ~ A_Lens, a ~ IORef (Maybe r), b ~ IORef (Maybe r)) => LabelOptic "timerRegion" k (Env m r) (Env m r) a b Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

Methods

labelOptic :: Optic k NoIx (Env m r) (Env m r) a b Source #

HasAnyError (Env m r) Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

Methods

getAnyError :: Env m r -> TVar Bool Source #

HasCommandLogging (Env m r) Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

HasCommands (Env m r) Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

HasCommonLogging (Env m r) Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

HasFileLogging (Env m r) Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

HasInit (Env m r) Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

Methods

getInit :: Env m r -> Maybe Text Source #

HasTimeout (Env m r) Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

MonadRegionLogger m => MonadRegionLogger (ShellT (Env notifyEnv r) m) Source # 
Instance details

Defined in Shrun.ShellT

Associated Types

type Region (ShellT (Env notifyEnv r) m) 
Instance details

Defined in Shrun.ShellT

type Region (ShellT (Env notifyEnv r) m) = Region (ReaderT (Env notifyEnv r) m)

Methods

logGlobal :: Text -> ShellT (Env notifyEnv r) m () Source #

logRegion :: LogMode -> Region (ShellT (Env notifyEnv r) m) -> Text -> ShellT (Env notifyEnv r) m () Source #

withRegion :: HasCallStack => RegionLayout -> (Region (ShellT (Env notifyEnv r) m) -> ShellT (Env notifyEnv r) m a) -> ShellT (Env notifyEnv r) m a Source #

displayRegions :: HasCallStack => ShellT (Env notifyEnv r) m a -> ShellT (Env notifyEnv r) m a Source #

regionList :: ShellT (Env notifyEnv r) m (TMVar [Region (ShellT (Env notifyEnv r) m)]) Source #

HasConsoleLogging (Env m r) r Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

HasNotifyConfig (Env notifyEnv r) notifyEnv Source # 
Instance details

Defined in Shrun.Configuration.Env.Types

Methods

getNotifyConfig :: Env notifyEnv r -> Maybe (NotificationEnv notifyEnv) Source #

type Region (ShellT (Env notifyEnv r) m) Source # 
Instance details

Defined in Shrun.ShellT

type Region (ShellT (Env notifyEnv r) m) = Region (ReaderT (Env notifyEnv r) m)

whenDebug :: (HasCommonLogging env, MonadReader env m) => m () -> m () Source #

Run the action when the debug flag is active.