module Database.Sybase.Sysmon.LogTypes where
import Data.IntervalMap.FingerTree
import Data.ConfigFile (ConfigParser)
import Data.Time
import Text.Printf
type Hint = (RuleId, Action, Facts)
type Facts = [String]
type Result = (Bool, Facts)
type RuleId = String
type Action = String
type LogTree a = IntervalMap UTCTime a
type LogInterval = Interval UTCTime
data LogNode a = LogNode (LogInterval, a)
class LogEntry a where
mkNode :: a -> LogNode a
mkParse :: String -> a
mkHints :: ConfigParser -> a -> [Hint]
mkLogTree :: [LogNode a] -> LogTree a
mkLogTree = foldr ins empty where
ins (LogNode (i, e)) = insert i e
class (Show a) => LogShow a where
lshow :: a -> String
lshow = show
instance LogShow Int
instance LogShow Integer
instance LogShow Bool
instance LogShow Double where
lshow = printf "%.2f"