Safe Haskell | None |
---|---|
Language | Haskell2010 |
Meta-module that reexports many Imm sub-modules.
Synopsis
- data LogLevel
- log :: Handle m -> LogLevel -> Doc AnsiStyle -> m ()
- getLogLevel :: Handle m -> m LogLevel
- setLogLevel :: Handle m -> LogLevel -> m ()
- setColorizeLogs :: Handle m -> Bool -> m ()
- flushLogs :: Handle m -> m ()
- _withGet :: Handle m -> forall a. URI -> (Producer' ByteString m () -> m a) -> m a
- withGet :: Monad m => Handle m -> Handle m -> URI -> (Producer' ByteString m () -> m a) -> m a
- data FeedURI = FeedURI (URIRef a)
- data FeedElement
- data Feed
- data FeedQuery
- = ByDatabaseID Int
- | ByURI URI
- | AllFeeds
- data FeedLocation
- sameURIType :: URIRef a1 -> URIRef a2 -> Maybe (URIRef a1 :~: URIRef a2)
- withFeedURI :: (forall a. URIRef a -> b) -> FeedURI -> b
- renderFeed :: Feed -> Text
- renderFeedElement :: FeedElement -> Text
- parseFeed :: MonadCatch m => Text -> m Feed
- parseFeedElement :: MonadCatch m => Text -> m FeedElement
- removeElements :: Feed -> Feed
- getFeedTitle :: Feed -> Text
- getElements :: Feed -> [FeedElement]
- getDate :: FeedElement -> Maybe UTCTime
- getTitle :: FeedElement -> Text
- getContent :: FeedElement -> Text
- getLink :: FeedElement -> Maybe FeedURI
- getId :: FeedElement -> Text
- prettyElement :: FeedElement -> Doc a
- parseXml :: Handle m -> URI -> LByteString -> m Feed
- data Callback = Callback {
- _executable :: FilePath
- _arguments :: [Text]
- serializeMessage :: Feed -> FeedElement -> LByteString
- deserializeMessage :: MonadFail m => LByteString -> m (Feed, FeedElement)
- data DatabaseException
- _describeDatabase :: Handle m -> m (Doc AnsiStyle)
- _fetch :: Handle m -> [EntryKey] -> m (Map EntryKey (Int, Entry))
- _fetchAll :: Handle m -> m (Map Int Entry)
- _update :: Handle m -> [EntryKey] -> (Entry -> Entry) -> m ()
- _insert :: Handle m -> [Entry] -> m (Map FeedLocation Int)
- _delete :: Handle m -> [EntryKey] -> m ()
- _purge :: Handle m -> m ()
- _commit :: Handle m -> m ()
- data EntryKey
- data FeedStatus
- = Unknown
- | New
- | LastUpdate UTCTime
- data Entry = Entry {}
- newtype JsonElement = JsonElement {}
- getHashes :: FeedElement -> [Int]
- prettyShortEntry :: Entry -> Doc AnsiStyle
- prettyEntry :: Entry -> Doc AnsiStyle
- makeEntry :: FeedLocation -> Set Text -> Entry
- matching :: FeedQuery -> Int -> Entry -> Bool
- readOnly :: Monad m => Handle m -> Handle m -> Handle m
- fetch1 :: Monad m => MonadThrow m => Handle m -> EntryKey -> m (Int, Entry)
- fetch :: Monad m => Handle m -> [EntryKey] -> m (Map EntryKey (Int, Entry))
- fetchQuery :: Monad m => Handle m -> (Int -> Entry -> Bool) -> m (Map Int Entry)
- fetchAll :: Monad m => Handle m -> m (Map Int Entry)
- update :: Monad m => Handle m -> [EntryKey] -> (Entry -> Entry) -> m ()
- insert :: MonadThrow m => Handle m -> Handle m -> Entry -> m Int
- insertList :: Monad m => Handle m -> Handle m -> [Entry] -> m (Map FeedLocation Int)
- delete1 :: Monad m => Handle m -> Handle m -> EntryKey -> m ()
- delete :: Monad m => Handle m -> Handle m -> [EntryKey] -> m ()
- purge :: Monad m => Handle m -> Handle m -> m ()
- commit :: Monad m => Handle m -> Handle m -> m ()
- register :: MonadThrow m => Handle m -> Handle m -> FeedLocation -> Set Text -> m Int
- getStatus :: MonadCatch m => Handle m -> EntryKey -> m FeedStatus
- markAsProcessed :: MonadThrow m => MonadTime m => Handle m -> Handle m -> EntryKey -> FeedElement -> m ()
- markAsUnprocessed :: MonadThrow m => Handle m -> Handle m -> EntryKey -> m ()
- listUnprocessedElements :: MonadThrow m => Handle m -> EntryKey -> m [FeedElement]
- isRead :: MonadCatch m => Handle m -> EntryKey -> FeedElement -> m Bool
- resolveEntryKey :: Monad m => Handle m -> FeedQuery -> m [EntryKey]
- resolveFeedLocation :: Monad m => Handle m -> EntryKey -> m FeedLocation
Documentation
getLogLevel :: Handle m -> m LogLevel Source #
setLogLevel :: Handle m -> LogLevel -> m () Source #
setColorizeLogs :: Handle m -> Bool -> m () Source #
withGet :: Monad m => Handle m -> Handle m -> URI -> (Producer' ByteString m () -> m a) -> m a Source #
Simple wrapper around _withGet
that also logs the requested URI.
data FeedElement Source #
Instances
Eq FeedElement Source # | |
Defined in Imm.Feed (==) :: FeedElement -> FeedElement -> Bool # (/=) :: FeedElement -> FeedElement -> Bool # | |
Ord FeedElement Source # | |
Defined in Imm.Feed compare :: FeedElement -> FeedElement -> Ordering # (<) :: FeedElement -> FeedElement -> Bool # (<=) :: FeedElement -> FeedElement -> Bool # (>) :: FeedElement -> FeedElement -> Bool # (>=) :: FeedElement -> FeedElement -> Bool # max :: FeedElement -> FeedElement -> FeedElement # min :: FeedElement -> FeedElement -> FeedElement # | |
Show FeedElement Source # | |
Defined in Imm.Feed showsPrec :: Int -> FeedElement -> ShowS # show :: FeedElement -> String # showList :: [FeedElement] -> ShowS # | |
Pretty (PrettyKey FeedElement) Source # | |
Defined in Imm.Feed pretty :: PrettyKey FeedElement -> Doc ann # prettyList :: [PrettyKey FeedElement] -> Doc ann # |
A query describes a set of feeds through some criteria.
data FeedLocation Source #
Feed location identifies a feed. It is either: - the feed URI - a webpage URI that refers to the feed through an alternate link, in which case an optional feed title can be provided to disambiguate multiple such links
Instances
withFeedURI :: (forall a. URIRef a -> b) -> FeedURI -> b Source #
renderFeed :: Feed -> Text Source #
renderFeedElement :: FeedElement -> Text Source #
parseFeedElement :: MonadCatch m => Text -> m FeedElement Source #
removeElements :: Feed -> Feed Source #
getFeedTitle :: Feed -> Text Source #
getElements :: Feed -> [FeedElement] Source #
getTitle :: FeedElement -> Text Source #
getContent :: FeedElement -> Text Source #
getId :: FeedElement -> Text Source #
prettyElement :: FeedElement -> Doc a Source #
External program run for each feed element.
Data is passed to that program through standard input (stdin
), using Avro (https://hackage.haskell.org/package/avro) serialization format. The data schema is described in file ids/callback.json
, provided with this library.
Callback | |
|
Instances
Eq Callback Source # | |
Ord Callback Source # | |
Defined in Imm.Callback | |
Read Callback Source # | |
Show Callback Source # | |
Generic Callback Source # | |
FromDhall Callback Source # | |
Defined in Imm.Callback autoWith :: InputNormalizer -> Decoder Callback # | |
Pretty Callback Source # | |
Defined in Imm.Callback | |
type Rep Callback Source # | |
Defined in Imm.Callback type Rep Callback = D1 (MetaData "Callback" "Imm.Callback" "imm-1.10.0.0-377OdLQgGSoCHB8Qc5Ycpd" False) (C1 (MetaCons "Callback" PrefixI True) (S1 (MetaSel (Just "_executable") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath) :*: S1 (MetaSel (Just "_arguments") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Text]))) |
serializeMessage :: Feed -> FeedElement -> LByteString Source #
Meant to be called by the main imm
process.
deserializeMessage :: MonadFail m => LByteString -> m (Feed, FeedElement) Source #
Meant to be called by callback process.
data DatabaseException Source #
NotCommitted | |
NotDeleted [FeedLocation] | |
KeyNotFound [EntryKey] | |
NotInserted [Entry] | |
NotPurged | |
NotUpdated FeedLocation | |
UnableFetchAll |
Instances
Eq DatabaseException Source # | |
Defined in Imm.Database.Feed (==) :: DatabaseException -> DatabaseException -> Bool # (/=) :: DatabaseException -> DatabaseException -> Bool # | |
Show DatabaseException Source # | |
Defined in Imm.Database.Feed showsPrec :: Int -> DatabaseException -> ShowS # show :: DatabaseException -> String # showList :: [DatabaseException] -> ShowS # | |
Exception DatabaseException Source # | |
Defined in Imm.Database.Feed | |
Pretty DatabaseException Source # | |
Defined in Imm.Database.Feed pretty :: DatabaseException -> Doc ann # prettyList :: [DatabaseException] -> Doc ann # |
data FeedStatus Source #
Instances
Pretty FeedStatus Source # | |
Defined in Imm.Database.Feed pretty :: FeedStatus -> Doc ann # prettyList :: [FeedStatus] -> Doc ann # |
Entry | |
|
newtype JsonElement Source #
Newtype wrapper to provide FromJSON
and ToJSON
instances for FeedElement
Instances
Eq JsonElement Source # | |
Defined in Imm.Database.Feed (==) :: JsonElement -> JsonElement -> Bool # (/=) :: JsonElement -> JsonElement -> Bool # | |
Ord JsonElement Source # | |
Defined in Imm.Database.Feed compare :: JsonElement -> JsonElement -> Ordering # (<) :: JsonElement -> JsonElement -> Bool # (<=) :: JsonElement -> JsonElement -> Bool # (>) :: JsonElement -> JsonElement -> Bool # (>=) :: JsonElement -> JsonElement -> Bool # max :: JsonElement -> JsonElement -> JsonElement # min :: JsonElement -> JsonElement -> JsonElement # | |
ToJSON JsonElement Source # | |
Defined in Imm.Database.Feed toJSON :: JsonElement -> Value # toEncoding :: JsonElement -> Encoding # toJSONList :: [JsonElement] -> Value # toEncodingList :: [JsonElement] -> Encoding # | |
ToJSONKey JsonElement Source # | |
Defined in Imm.Database.Feed | |
FromJSON JsonElement Source # | |
Defined in Imm.Database.Feed parseJSON :: Value -> Parser JsonElement # parseJSONList :: Value -> Parser [JsonElement] # | |
FromJSONKey JsonElement Source # | |
getHashes :: FeedElement -> [Int] Source #
insertList :: Monad m => Handle m -> Handle m -> [Entry] -> m (Map FeedLocation Int) Source #
register :: MonadThrow m => Handle m -> Handle m -> FeedLocation -> Set Text -> m Int Source #
getStatus :: MonadCatch m => Handle m -> EntryKey -> m FeedStatus Source #
markAsProcessed :: MonadThrow m => MonadTime m => Handle m -> Handle m -> EntryKey -> FeedElement -> m () Source #
markAsUnprocessed :: MonadThrow m => Handle m -> Handle m -> EntryKey -> m () Source #
listUnprocessedElements :: MonadThrow m => Handle m -> EntryKey -> m [FeedElement] Source #
isRead :: MonadCatch m => Handle m -> EntryKey -> FeedElement -> m Bool Source #
resolveFeedLocation :: Monad m => Handle m -> EntryKey -> m FeedLocation Source #