chore(tazblog): Introduce dependency on 'cache'
This commit is contained in:
parent
b856648127
commit
13b0204c03
3 changed files with 23 additions and 19 deletions
|
@ -15,33 +15,36 @@
|
||||||
--
|
--
|
||||||
-- This module implements logic for assembling a post out of these
|
-- This module implements logic for assembling a post out of these
|
||||||
-- fragments and caching it based on the TTL of its `_meta` record.
|
-- fragments and caching it based on the TTL of its `_meta` record.
|
||||||
|
|
||||||
module BlogStore where
|
module BlogStore where
|
||||||
|
|
||||||
import Data.Text (Text)
|
|
||||||
import Locales (BlogLang(..))
|
|
||||||
import Data.Time (UTCTime)
|
|
||||||
import Control.Monad.IO.Class (MonadIO)
|
import Control.Monad.IO.Class (MonadIO)
|
||||||
|
import Data.Text (Text)
|
||||||
|
import Data.Time (UTCTime)
|
||||||
|
import Locales (BlogLang (..))
|
||||||
|
|
||||||
newtype EntryId = EntryId {unEntryId :: Integer}
|
newtype EntryId = EntryId {unEntryId :: Integer}
|
||||||
deriving (Eq, Ord)
|
deriving (Eq, Ord)
|
||||||
|
|
||||||
instance Show EntryId where
|
instance Show EntryId where
|
||||||
|
|
||||||
show = show . unEntryId
|
show = show . unEntryId
|
||||||
|
|
||||||
data Entry = Entry {
|
data Entry
|
||||||
entryId :: EntryId,
|
= Entry
|
||||||
|
{ entryId :: EntryId,
|
||||||
lang :: BlogLang,
|
lang :: BlogLang,
|
||||||
author :: Text,
|
author :: Text,
|
||||||
title :: Text,
|
title :: Text,
|
||||||
btext :: Text,
|
btext :: Text,
|
||||||
mtext :: Text,
|
mtext :: Text,
|
||||||
edate :: UTCTime
|
edate :: UTCTime
|
||||||
} deriving (Eq, Ord, Show)
|
}
|
||||||
|
deriving (Eq, Ord, Show)
|
||||||
|
|
||||||
data BlogCache
|
data BlogCache
|
||||||
|
|
||||||
type Offset = Integer
|
type Offset = Integer
|
||||||
|
|
||||||
type Count = Integer
|
type Count = Integer
|
||||||
|
|
||||||
newCache :: String -> IO BlogCache
|
newCache :: String -> IO BlogCache
|
||||||
|
|
|
@ -19,6 +19,7 @@ library
|
||||||
text,
|
text,
|
||||||
blaze-html,
|
blaze-html,
|
||||||
blaze-markup,
|
blaze-markup,
|
||||||
|
cache,
|
||||||
crypto-api,
|
crypto-api,
|
||||||
cryptohash,
|
cryptohash,
|
||||||
old-locale,
|
old-locale,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ mkDerivation, acid-state, base, base64-bytestring, blaze-html
|
{ mkDerivation, acid-state, base, base64-bytestring, blaze-html
|
||||||
, blaze-markup, bytestring, crypto-api, cryptohash, hamlet
|
, blaze-markup, bytestring, cache, crypto-api, cryptohash, hamlet
|
||||||
, happstack-server, ixset, markdown, mtl, network, network-uri
|
, happstack-server, markdown, mtl, network, network-uri
|
||||||
, old-locale, options, rss, safecopy, shakespeare, stdenv, text
|
, old-locale, options, rss, shakespeare, stdenv, text
|
||||||
, time, transformers
|
, time, transformers
|
||||||
}:
|
}:
|
||||||
mkDerivation {
|
mkDerivation {
|
||||||
|
@ -12,7 +12,7 @@ mkDerivation {
|
||||||
isExecutable = true;
|
isExecutable = true;
|
||||||
libraryHaskellDepends = [
|
libraryHaskellDepends = [
|
||||||
base base64-bytestring blaze-html blaze-markup bytestring
|
base base64-bytestring blaze-html blaze-markup bytestring
|
||||||
crypto-api cryptohash hamlet happstack-server markdown mtl
|
cache crypto-api cryptohash hamlet happstack-server markdown mtl
|
||||||
network network-uri old-locale rss shakespeare text time
|
network network-uri old-locale rss shakespeare text time
|
||||||
transformers
|
transformers
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue