Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- header :: Parser RecordHeader
- encodeHeader :: RecordHeader -> Builder
- data Version = Version {
- versionMajor, versionMinor :: !Int
- warc0_16 :: Version
- data RecordHeader = RecordHeader {}
- data WarcType
- newtype RecordId = RecordId Uri
- data TruncationReason
- data Digest = Digest {}
- newtype Uri = Uri ByteString
- data Field a = Field {}
- newtype FieldName = FieldName {
- getFieldName :: Text
- field :: Field a -> Traversal' RecordHeader a
- lookupField :: RecordHeader -> Field a -> Maybe (Either String a)
- addField :: Field a -> a -> RecordHeader -> RecordHeader
- mapField :: (a -> b) -> (b -> a) -> Field a -> Field b
- rawField :: FieldName -> Field ByteString
- warcRecordId :: Field RecordId
- contentLength :: Field Integer
- warcDate :: Field UTCTime
- warcType :: Field WarcType
- contentType :: Field ByteString
- warcConcurrentTo :: Field RecordId
- warcBlockDigest :: Field Digest
- warcPayloadDigest :: Field Digest
- warcIpAddress :: Field ByteString
- warcRefersTo :: Field Uri
- warcTargetUri :: Field Uri
- warcTruncated :: Field TruncationReason
- warcWarcinfoID :: Field RecordId
- warcFilename :: Field Text
- warcProfile :: Field Uri
- warcSegmentNumber :: Field Integer
- warcSegmentTotalLength :: Field Integer
- recWarcVersion :: Lens' RecordHeader Version
- recHeaders :: Lens' RecordHeader (HashMap FieldName ByteString)
Parsing
header :: Parser RecordHeader Source #
A WARC header
Encoding
encodeHeader :: RecordHeader -> Builder Source #
WARC Version
Types
data RecordHeader Source #
Instances
Show RecordHeader Source # | |
Defined in Data.Warc.Header showsPrec :: Int -> RecordHeader -> ShowS # show :: RecordHeader -> String # showList :: [RecordHeader] -> ShowS # |
data TruncationReason Source #
Instances
Eq TruncationReason Source # | |
Defined in Data.Warc.Header (==) :: TruncationReason -> TruncationReason -> Bool # (/=) :: TruncationReason -> TruncationReason -> Bool # | |
Ord TruncationReason Source # | |
Defined in Data.Warc.Header compare :: TruncationReason -> TruncationReason -> Ordering # (<) :: TruncationReason -> TruncationReason -> Bool # (<=) :: TruncationReason -> TruncationReason -> Bool # (>) :: TruncationReason -> TruncationReason -> Bool # (>=) :: TruncationReason -> TruncationReason -> Bool # max :: TruncationReason -> TruncationReason -> TruncationReason # min :: TruncationReason -> TruncationReason -> TruncationReason # | |
Read TruncationReason Source # | |
Defined in Data.Warc.Header | |
Show TruncationReason Source # | |
Defined in Data.Warc.Header showsPrec :: Int -> TruncationReason -> ShowS # show :: TruncationReason -> String # showList :: [TruncationReason] -> ShowS # |
Header field types
field :: Field a -> Traversal' RecordHeader a Source #
A lens-y means of querying Field
s.
lookupField :: RecordHeader -> Field a -> Maybe (Either String a) Source #
Lookup the value of a field. Returns Nothing
if the field is not
present, Just (Left err)
in the event of a parse error, and
Just (Right v)
on success.
addField :: Field a -> a -> RecordHeader -> RecordHeader Source #
Standard fields
warcRefersTo :: Field Uri Source #
warcTargetUri :: Field Uri Source #
warcFilename :: Field Text Source #
warcProfile :: Field Uri Source #