hackage-security-0.6.3.2: 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 Source #

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

data TargetPath Source #

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

Constructors

TargetPathRepo RepoPath |
TargetPathIndex IndexPath |

#### Instances

Instances details

Show TargetPath Source # |
Instance details Defined in Hackage.Security.TUF.FileMap Methods showsPrec :: Int -> TargetPath -> ShowS Source # show :: TargetPath -> String Source # showList :: [TargetPath] -> ShowS Source #
Eq TargetPath Source # |
Instance details Defined in Hackage.Security.TUF.FileMap Methods (==) :: TargetPath -> TargetPath -> Bool Source # (/=) :: TargetPath -> TargetPath -> Bool Source #
Ord TargetPath Source # |

Instance details

Defined in Hackage.Security.TUF.FileMap

Methods

compare :: TargetPath -> TargetPath -> Ordering Source #

(<) :: TargetPath -> TargetPath -> Bool Source #

(<=) :: TargetPath -> TargetPath -> Bool Source #

(>) :: TargetPath -> TargetPath -> Bool Source #

(>=) :: TargetPath -> TargetPath -> Bool Source #

max :: TargetPath -> TargetPath -> TargetPath Source #

min :: TargetPath -> TargetPath -> TargetPath Source #

Pretty TargetPath Source # |
Instance details Defined in Hackage.Security.TUF.FileMap Methods pretty :: TargetPath -> String Source #
ReportSchemaErrors m => FromObjectKey m TargetPath Source # |
Instance details Defined in Hackage.Security.TUF.FileMap Methods fromObjectKey :: String -> m (Maybe TargetPath) Source #
Monad m => ToObjectKey m TargetPath Source # |
Instance details Defined in Hackage.Security.TUF.FileMap Methods toObjectKey :: TargetPath -> m String Source #

# Standard accessors

empty :: FileMap Source #

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

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

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

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

# Comparing file maps

data FileChange Source #

Constructors

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

#### Instances

Instances details

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

fileMapChanges Source #

Arguments

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