| License | AGPL-3 |
|---|---|
| Maintainer | stu235271@mail.uni-kiel.de stu236925@mail.uni-kiel.de |
| Safe Haskell | None |
| Language | Haskell2010 |
Docs.Revision
Description
This module contains data types and related utility functions for a generic revision, meaning text or tree.
Synopsis
- newtype RevisionID = RevisionID {}
- data TextOrTree
- data RevisionKey = RevisionKey {}
- data RevisionRef = RevisionRef DocumentID RevisionSelector
- data RevisionSelector
- selectorFromTextRevision :: TextRevisionSelector -> RevisionSelector
- refFromTextRevision :: TextRevisionRef -> RevisionRef
- specificRevision :: RevisionSelector -> Maybe RevisionID
- latestRevisionAsOf :: RevisionSelector -> Maybe UTCTime
- textRevisionRefFor :: TextElementRef -> RevisionKey -> TextRevisionRef
- treeRevisionRefFor :: DocumentID -> RevisionKey -> TreeRevisionRef
- prettyPrintRevisionRef :: RevisionRef -> String
Documentation
newtype RevisionID Source #
The id of a revision
Constructors
| RevisionID | |
Fields | |
Instances
data TextOrTree Source #
A TextRevisionRef or a TreeRevisionRef.
Constructors
| Text TextRevisionRef | |
| Tree TreeRevisionRef |
Instances
data RevisionKey Source #
An arbitrary revision, but the type (tree or text) is known.
Constructors
| RevisionKey | |
Fields
| |
Instances
| FromJSON RevisionKey Source # | |||||
Defined in Docs.Revision | |||||
| ToJSON RevisionKey Source # | |||||
Defined in Docs.Revision Methods toJSON :: RevisionKey -> Value toEncoding :: RevisionKey -> Encoding toJSONList :: [RevisionKey] -> Value toEncodingList :: [RevisionKey] -> Encoding omitField :: RevisionKey -> Bool | |||||
| Generic RevisionKey Source # | |||||
Defined in Docs.Revision Associated Types
| |||||
| ToSchema RevisionKey Source # | |||||
Defined in Docs.Revision Methods declareNamedSchema :: Proxy RevisionKey -> Declare (Definitions Schema) NamedSchema | |||||
| type Rep RevisionKey Source # | |||||
Defined in Docs.Revision type Rep RevisionKey = D1 ('MetaData "RevisionKey" "Docs.Revision" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "RevisionKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "timestamp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "revision") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TextOrTree))) | |||||
data RevisionRef Source #
Reference of a revision
Constructors
| RevisionRef DocumentID RevisionSelector |
Instances
| FromJSON RevisionRef Source # | |||||
Defined in Docs.Revision | |||||
| ToJSON RevisionRef Source # | |||||
Defined in Docs.Revision Methods toJSON :: RevisionRef -> Value toEncoding :: RevisionRef -> Encoding toJSONList :: [RevisionRef] -> Value toEncodingList :: [RevisionRef] -> Encoding omitField :: RevisionRef -> Bool | |||||
| Generic RevisionRef Source # | |||||
Defined in Docs.Revision Associated Types
| |||||
| ToSchema RevisionRef Source # | |||||
Defined in Docs.Revision Methods declareNamedSchema :: Proxy RevisionRef -> Declare (Definitions Schema) NamedSchema | |||||
| type Rep RevisionRef Source # | |||||
Defined in Docs.Revision type Rep RevisionRef = D1 ('MetaData "RevisionRef" "Docs.Revision" "backend-0.1.0.0-2H73EnUlGVcEtlIi2XNQz3" 'False) (C1 ('MetaCons "RevisionRef" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DocumentID) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RevisionSelector))) | |||||
data RevisionSelector Source #
Selector for a revision
Constructors
| Latest | selects the latest revision |
| LatestAsOf UTCTime | selects the latest revision at a specific point of time |
| Specific RevisionID | selects a specific revision by its id |
Instances
| FromJSON RevisionSelector Source # | |
Defined in Docs.Revision Methods parseJSON :: Value -> Parser RevisionSelector parseJSONList :: Value -> Parser [RevisionSelector] | |
| ToJSON RevisionSelector Source # | |
Defined in Docs.Revision Methods toJSON :: RevisionSelector -> Value toEncoding :: RevisionSelector -> Encoding toJSONList :: [RevisionSelector] -> Value toEncodingList :: [RevisionSelector] -> Encoding omitField :: RevisionSelector -> Bool | |
| Show RevisionSelector Source # | |
Defined in Docs.Revision Methods showsPrec :: Int -> RevisionSelector -> ShowS # show :: RevisionSelector -> String # showList :: [RevisionSelector] -> ShowS # | |
| FromHttpApiData RevisionSelector Source # | |
Defined in Docs.Revision Methods parseUrlPiece :: Text -> Either Text RevisionSelector | |
| ToParamSchema RevisionSelector Source # | |
Defined in Docs.Revision Methods toParamSchema :: Proxy RevisionSelector -> Schema | |
| ToSchema RevisionSelector Source # | |
Defined in Docs.Revision Methods declareNamedSchema :: Proxy RevisionSelector -> Declare (Definitions Schema) NamedSchema | |
refFromTextRevision :: TextRevisionRef -> RevisionRef Source #
Get an arbitrary ref from a TextRevisionRef.
specificRevision :: RevisionSelector -> Maybe RevisionID Source #
The revision id if it is a Specific selector; Nothing otherwise.
latestRevisionAsOf :: RevisionSelector -> Maybe UTCTime Source #
The timestampt, if ti is a LatestAsOf selector; Nothing otherwise.
textRevisionRefFor :: TextElementRef -> RevisionKey -> TextRevisionRef Source #
Get the ref for a given text revision with respect to a RevisionKey.
If the revision key belongs to the given TextElementRef, it is returned as a
TextRevisionRef. Otherwise, a selector for the latest revision for the given text
element for the timestamp of the given RevisionKey is returned.
treeRevisionRefFor :: DocumentID -> RevisionKey -> TreeRevisionRef Source #
Get the ref for a given tree revision with respect to a RevisionKey.
If the revision key belongs to the given DocumentID, it is returned as a
TreeRevisionRef. Otherwise, a selector for the latest revision for the given tree
element for the timestamp of the given RevisionKey is returned.
prettyPrintRevisionRef :: RevisionRef -> String Source #
RevisionRef. Schöööööööön.