]> gitweb @ CieloNegro.org - Rakka.git/blob - Rakka/Storage/Types.hs
continue working on page search
[Rakka.git] / Rakka / Storage / Types.hs
1 module Rakka.Storage.Types
2     ( Storage(..)
3     , IndexReq(..)
4     , SearchResult(..)
5     , SnippetFragment(..)
6     )
7     where
8
9 import           Control.Concurrent.STM
10 import           Rakka.Page
11 import           Subversion.Repository
12 import           Subversion.Types
13 import           Text.HyperEstraier hiding (WriteLock)
14
15
16 data Storage
17     = Storage {
18         stoRepository :: !Repository
19       , stoIndexChan  :: !(TChan IndexReq)
20       }
21
22
23 data IndexReq
24     = RebuildIndex
25     | SyncIndex
26     | SearchIndex !Condition !(TMVar [SearchResult])
27
28
29 data SearchResult
30     = SearchResult {
31         srPageName :: !PageName
32       , srPageRev  :: !RevNum
33       , srSnippet  :: [SnippetFragment]
34       }
35     deriving (Show, Eq)
36
37
38 data SnippetFragment
39     = NormalText      !String
40     | HighlightedWord !String
41     deriving (Show, Eq)