hackage-security-0.6.3.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 Source #

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 Source #

#### Instances

Instances details

DownloadedFile LocalFile Source # |
Instance details Defined in Hackage.Security.Client.Repository.Local Methods downloadedVerify :: LocalFile a -> Trusted FileInfo -> IO Bool Source # downloadedRead :: LocalFile Metadata -> IO ByteString Source # downloadedCopyTo :: LocalFile a -> Path Absolute -> IO () Source #

withRepository Source #

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.