hackage-security-0.6.2.6: Hackage security library

Safe Haskell | None
Language | Haskell2010

Hackage.Security.TUF.FileMap

Contents

- Standard accessors
- Comparing file maps

Description

Information about files

Intended to be double imported

    import Hackage.Security.TUF.FileMap (FileMap)
    import qualified Hackage.Security.TUF.FileMap as FileMap

Synopsis

- data FileMap
- data TargetPath
  - = TargetPathRepo RepoPath
  - | TargetPathIndex IndexPath
- empty :: FileMap
- lookup :: TargetPath -> FileMap -> Maybe FileInfo
- (!) :: FileMap -> TargetPath -> FileInfo
- insert :: TargetPath -> FileInfo -> FileMap -> FileMap
- fromList :: [(TargetPath, FileInfo)] -> FileMap
- data FileChange
  - = FileChanged FileInfo
  - | FileDeleted
- fileMapChanges :: FileMap -> FileMap -> Map TargetPath FileChange

# Documentation

data FileMap #

Mapping from paths to file info

File maps are used in target files; the paths are relative to the location of the target files containing the file map.

#### Instances

Instances details

Show FileMap # |
Instance details Defined in Hackage.Security.TUF.FileMap Methods showsPrec :: Int -> FileMap -> ShowS # show :: FileMap -> String # showList :: [FileMap] -> ShowS #
ReportSchemaErrors m => FromJSON m FileMap # |
Instance details Defined in Hackage.Security.TUF.FileMap Methods fromJSON :: JSValue -> m FileMap #
Monad m => ToJSON m FileMap # |
Instance details Defined in Hackage.Security.TUF.FileMap Methods toJSON :: FileMap -> m JSValue #

data TargetPath #

Entries in `FileMap` either talk about the repository or the index

Constructors

TargetPathRepo RepoPath |
TargetPathIndex IndexPath |

#### Instances

Instances details

Show TargetPath # |
Instance details Defined in Hackage.Security.TUF.FileMap Methods showsPrec :: Int -> TargetPath -> ShowS # show :: TargetPath -> String # showList :: [TargetPath] -> ShowS #
Eq TargetPath # |
Instance details Defined in Hackage.Security.TUF.FileMap Methods (==) :: TargetPath -> TargetPath -> Bool # (/=) :: TargetPath -> TargetPath -> Bool #
Ord TargetPath # |
Instance details Defined in Hackage.Security.TUF.FileMap Methods compare :: TargetPath -> TargetPath -> Ordering # (<) :: TargetPath -> TargetPath -> Bool # (<=) :: TargetPath -> TargetPath -> Bool # (>) :: TargetPath -> TargetPath -> Bool # (>=) :: TargetPath -> TargetPath -> Bool # max :: TargetPath -> TargetPath -> TargetPath # min :: TargetPath -> TargetPath -> TargetPath #
Pretty TargetPath # |
Instance details Defined in Hackage.Security.TUF.FileMap Methods pretty :: TargetPath -> String #
ReportSchemaErrors m => FromObjectKey m TargetPath # |
Instance details Defined in Hackage.Security.TUF.FileMap Methods fromObjectKey :: String -> m (Maybe TargetPath) #
Monad m => ToObjectKey m TargetPath # |
Instance details Defined in Hackage.Security.TUF.FileMap Methods toObjectKey :: TargetPath -> m String #

# Standard accessors

empty :: FileMap #

lookup :: TargetPath -> FileMap -> Maybe FileInfo #

(!) :: FileMap -> TargetPath -> FileInfo #

insert :: TargetPath -> FileInfo -> FileMap -> FileMap #

fromList :: [(TargetPath, FileInfo)] -> FileMap #

# Comparing file maps

data FileChange #

Constructors

FileChanged FileInfo | File got added or modified; we record the new file info
FileDeleted | File got deleted

#### Instances

Instances details

Show FileChange # |
Instance details Defined in Hackage.Security.TUF.FileMap Methods showsPrec :: Int -> FileChange -> ShowS # show :: FileChange -> String # showList :: [FileChange] -> ShowS #

fileMapChanges #

Arguments

:: FileMap | Old
-> FileMap | New
-> Map TargetPath FileChange |