Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data PackageDownload = PackageDownload {
- pdSHA256 :: !StaticSHA256
- pdUrl :: !ByteString
- pdSize :: !Word64
- newtype HSPackageDownload = HSPackageDownload {}
- newtype PackageCache index = PackageCache (HashMap PackageName (HashMap Version (index, Maybe PackageDownload, NonEmpty ([CabalHash], OffsetSize))))
- data OffsetSize = OffsetSize !Int64 !Int64
- data PackageIndex = PackageIndex {
- indexName :: !IndexName
- indexLocation :: !Text
- indexType :: !IndexType
- indexDownloadPrefix :: !Text
- indexRequireHashes :: !Bool
- newtype IndexName = IndexName {}
- indexNameText :: IndexName -> Text
- data IndexType
- data HackageSecurity = HackageSecurity {
- hsKeyIds :: ![Text]
- hsKeyThreshold :: !Int
Documentation
data PackageDownload Source #
PackageDownload | |
|
Instances
newtype HSPackageDownload Source #
Hackage Security provides a different JSON format, we'll have our own JSON parser for it.
Instances
FromJSON HSPackageDownload Source # | |
Defined in Stack.Types.PackageIndex parseJSON :: Value -> Parser HSPackageDownload # parseJSONList :: Value -> Parser [HSPackageDownload] # |
newtype PackageCache index Source #
Cached information about packages in an index. We have a mapping from package name to a version map. Within the version map, we map from the version to information on an individual version. Each version has optional download information (about the package's tarball itself), and cabal file information. The cabal file information is a non-empty list of all cabal file revisions. Each file revision indicates the hash of the contents of the cabal file, and the offset into the index tarball.
The reason for each Version
mapping to a two element list of
CabalHash
es is because some older Stackage snapshots have CRs in
their cabal files. For compatibility with these older snapshots,
both hashes are stored: the first element of the two element list
being the original hash, and the (potential) second element with
the CRs stripped. [Note: This is was initially stored as a two
element list, and cannot be easily packed into more explict ADT or
newtype because of some template-haskell that would need to be
modified as well: the versionedDecodeOrLoad
function call found
in the getPackageCaches
function in PackageIndex
.]
It's assumed that cabal files appear in the index tarball in the correct revision order.
PackageCache (HashMap PackageName (HashMap Version (index, Maybe PackageDownload, NonEmpty ([CabalHash], OffsetSize)))) |
Instances
data OffsetSize Source #
offset in bytes into the 01-index.tar file for the .cabal file contents, and size in bytes of the .cabal file
Instances
PackageIndex, IndexName & IndexLocation
data PackageIndex Source #
Information on a single package index
PackageIndex | |
|
Instances
Show PackageIndex Source # | |
Defined in Stack.Types.PackageIndex showsPrec :: Int -> PackageIndex -> ShowS # show :: PackageIndex -> String # showList :: [PackageIndex] -> ShowS # | |
FromJSON (WithJSONWarnings PackageIndex) Source # | |
Defined in Stack.Types.PackageIndex parseJSON :: Value -> Parser (WithJSONWarnings PackageIndex) # parseJSONList :: Value -> Parser [WithJSONWarnings PackageIndex] # |
Unique name for a package index
indexNameText :: IndexName -> Text Source #
data HackageSecurity Source #
HackageSecurity | |
|
Instances
Eq HackageSecurity Source # | |
Defined in Stack.Types.PackageIndex (==) :: HackageSecurity -> HackageSecurity -> Bool # (/=) :: HackageSecurity -> HackageSecurity -> Bool # | |
Ord HackageSecurity Source # | |
Defined in Stack.Types.PackageIndex compare :: HackageSecurity -> HackageSecurity -> Ordering # (<) :: HackageSecurity -> HackageSecurity -> Bool # (<=) :: HackageSecurity -> HackageSecurity -> Bool # (>) :: HackageSecurity -> HackageSecurity -> Bool # (>=) :: HackageSecurity -> HackageSecurity -> Bool # max :: HackageSecurity -> HackageSecurity -> HackageSecurity # min :: HackageSecurity -> HackageSecurity -> HackageSecurity # | |
Show HackageSecurity Source # | |
Defined in Stack.Types.PackageIndex showsPrec :: Int -> HackageSecurity -> ShowS # show :: HackageSecurity -> String # showList :: [HackageSecurity] -> ShowS # | |
FromJSON HackageSecurity Source # | |
Defined in Stack.Types.PackageIndex parseJSON :: Value -> Parser HackageSecurity # parseJSONList :: Value -> Parser [HackageSecurity] # |