{-# LANGUAGE OverloadedStrings, NoImplicitPrelude  #-}
module AppGlobalState where
import Data.Int (Int)
import Prelude (String, Bool)
import qualified Data.Text as T
import qualified DB
import qualified LocalAuth
import qualified Cache
import qualified GoogleAuth
import qualified Database.SQLite.Simple as SQL

data ArchiveSettings = ArchiveSettings {
  asAllowedHosts :: [String],
  asSearchPageSize :: Int
  }


data AppGlobalState = AppGlobalState {
  sqlConnection :: DB.Db,
  sqlConnection2 :: SQL.Connection,
  gauth :: GoogleAuth.GoogleAuthState T.Text,
  lauth :: LocalAuth.LocalAuthState,
  messageCache :: Cache.Cache Int T.Text,
  host :: String,
  appSettings :: ArchiveSettings,
  googleAPIKey :: T.Text,
  autoPoll :: Bool,
  listenAddress :: T.Text,
  listenPort :: Int
  }
