Hackage.Security.Client.Repository.Local

hackage-security-0.5.2.2: Hackage security library

Safe Haskell | None
Language | Haskell2010

Hackage.Security.Client.Repository.Local

Description

Local repository

Synopsis

- type LocalRepo = Path Absolute
- data LocalFile a
- withRepository :: LocalRepo -> Cache -> RepoLayout -> IndexLayout -> (LogMessage -> IO ()) -> (Repository LocalFile -> IO a) -> IO a

# Documentation

type LocalRepo = Path Absolute #

Location of the repository

Note that we regard the local repository as immutable; we cache files just like we do for remote repositories.

data LocalFile a #

Instances

DownloadedFile LocalFile # |
Methods downloadedVerify :: LocalFile a -> Trusted FileInfo -> IO Bool # downloadedRead :: LocalFile Metadata -> IO ByteString # downloadedCopyTo :: LocalFile a -> Path Absolute -> IO () #

withRepository #

Arguments

:: LocalRepo | Location of local repository
-> Cache | Location of local cache
-> RepoLayout | Repository layout
-> IndexLayout | Index layout
-> (LogMessage -> IO ()) | Logger
-> (Repository LocalFile -> IO a) | Callback
-> IO a |

Initialize the repository (and cleanup resources afterwards)

Like a remote repository, a local repository takes a RepoLayout as argument; but where the remote repository interprets this RepoLayout relative to a URL, the local repository interprets it relative to a local directory.

It uses the same cache as the remote repository.