twitch-0.1.7.2: A high level file watcher DSL

Safe HaskellNone
LanguageHaskell2010

Twitch.InternalRule

Synopsis

Documentation

type Action = FilePath -> UTCTime -> IO () Source #

The actions that are run when file events are triggered

type FileTest = FilePath -> UTCTime -> Bool Source #

The test function to determine if a event Action should get fired

data InternalRule Source #

Constructors

InternalRule 

Fields

Instances
Show InternalRule Source # 
Instance details

Defined in Twitch.InternalRule

Default InternalRule Source # 
Instance details

Defined in Twitch.InternalRule

Methods

def :: InternalRule #

data Config Source #

Configuration to run the file watcher

Constructors

Config 

Fields

Instances
Show Config Source # 
Instance details

Defined in Twitch.InternalRule

Default Config Source # 
Instance details

Defined in Twitch.InternalRule

Methods

def :: Config #

data Issue Source #

A sum type for the various issues that can be logged

Constructors

IEvent Event

logged every time an event is fired

IRuleFired Event InternalRule

logged every time an rule is fired

Instances
Show Issue Source # 
Instance details

Defined in Twitch.InternalRule

Methods

showsPrec :: Int -> Issue -> ShowS #

show :: Issue -> String #

showList :: [Issue] -> ShowS #

fireRule :: Event -> InternalRule -> IO () Source #

Run the Rule action associated with the an event

testAndFireRule :: Config -> Event -> InternalRule -> IO () Source #

Test to see if the rule should fire and fire it

setupRuleForDir :: Config -> WatchManager -> [InternalRule] -> FilePath -> IO () Source #

Start watching a directory, and run the rules on it.

setupRules :: Config -> [InternalRule] -> IO WatchManager Source #

Setup all of the directory watches using the rules