habbix-0.1.0.0: Multi-Axis library/executable and misc. zabbix tools

Copyright(C) 2014 Samuli Thomasson
LicenseMIT (see the file LICENSE)
MaintainerSamuli Thomasson <samuli.thomasson@paivola.fi>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

ZabbixDB

Contents

Description

Habbix is the context in which we operate. Provides IO and two database connections via runLocalDB and runRemoteDB.

Synopsis

Documentation

data Habbix a

Instances

Monad Habbix 
Functor Habbix 
Applicative Habbix 
MonadIO Habbix 
MonadResource Habbix 
MonadThrow Habbix 
MonadLogger Habbix 
MonadBase IO Habbix 
MonadBaseControl IO Habbix 
data StM Habbix = StMHabbix {} 

runHabbix :: Bool -> Bool -> FilePath -> ConnectionString -> ConnectionString -> Habbix a -> IO a

runHabbix debugsql local remote action

type ConnectionString = ByteString

A libpq connection string. A simple example of connection string would be "host=localhost port=5432 user=test dbname=test password=test". Please read libpq's documentation at http://www.postgresql.org/docs/9.1/static/libpq-connect.html for more details on how to create such strings.

DB

runLocalDB :: DB a -> Habbix a

Execute a transaction in the local DB.

runRemoteDB :: SqlPersistT Habbix a -> Habbix a

Execute a transaction in the remote DB.

module Models

modelsDir :: HabbixState -> FilePath

Utility

type Epoch = Int

tshow :: Show a => a -> Text

asks :: MonadReader r m => (r -> a) -> m a