Copyright | (c) Michael Mounteney, 2016 |
---|---|
License | BSD 3 clause |
Maintainer | the project name, all lower case, at landcroft dot com |
Stability | experimental |
Portability | undefined |
Safe Haskell | None |
Language | Haskell2010 |
- type PostgresConnPool = Map PostgresConnection (Int, Connection)
- type DataSchemes = Map DataSourceId DataDescriptor
- type UserConfig = Map Text (UserId, [UserDeckCpt])
- data JRState = JRState {
- logLevel :: LogLevel
- tablesFile :: ConnectionPool
- secureOnly :: Bool
- shuffleCards :: Bool
- sessionTimeout :: Int
- portNumber :: Maybe Int
- keysFile :: FilePath
- databaseUser :: Text
- appRoot :: Text
- postgresConnections :: TVar PostgresConnPool
- dataSchemes :: TVar DataSchemes
- userConfig :: TVar UserConfig
- runFilteredLoggingT :: MonadIO m => JRState -> LoggingT m a -> m a
- getPostgresConnPool :: JRState -> IO PostgresConnPool
- getDataSchemes :: JRState -> IO DataSchemes
- getUserConfig :: JRState -> IO UserConfig
Documentation
type PostgresConnPool = Map PostgresConnection (Int, Connection) Source #
All external data references to one server (various tables) share one connection object. This structure manages it.
type DataSchemes = Map DataSourceId DataDescriptor Source #
Each data source has a corresponding in-memory structure, corresponding to a file handle, database connection etc.
type UserConfig = Map Text (UserId, [UserDeckCpt]) Source #
The key of the map is Text because the security subsystem returns a user id, which is Text. TODO: plumb Yesod.Auth to return a numeric id. instead.
The foundation object
JRState | |
|
runFilteredLoggingT :: MonadIO m => JRState -> LoggingT m a -> m a Source #
Run logging at the user-specified level of detail.
getPostgresConnPool :: JRState -> IO PostgresConnPool Source #
Get the Postgres connection pool map
getDataSchemes :: JRState -> IO DataSchemes Source #
Get the data source handle map
getUserConfig :: JRState -> IO UserConfig Source #
Get the user configuration map