Safe Haskell | None |
---|---|
Language | Haskell2010 |
Twitch.InternalRule
- type Action = FilePath -> UTCTime -> IO ()
- type FileTest = FilePath -> UTCTime -> Bool
- data InternalRule = InternalRule {}
- toInternalRule :: FilePath -> Rule -> Either RuleIssue InternalRule
- data Config = Config {
- logger :: Issue -> IO ()
- dirs :: [FilePath]
- watchConfig :: WatchConfig
- data Issue
- filePath :: Event -> FilePath
- time :: Event -> UTCTime
- fireRule :: Event -> InternalRule -> IO ()
- testAndFireRule :: Config -> Event -> InternalRule -> IO ()
- setupRuleForDir :: Config -> WatchManager -> [InternalRule] -> FilePath -> IO ()
- setupRules :: Config -> [InternalRule] -> IO WatchManager
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
toInternalRule :: FilePath -> Rule -> Either RuleIssue InternalRule Source
Configuration to run the file watcher
Constructors
Config | |
Fields
|
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 |
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