ContentsIndex
Darcs.Repository.Cache
Synopsis
data HashedDir
= HashedPristineDir
| HashedPatchesDir
| HashedInventoriesDir
hashedDir :: HashedDir -> String
data WritableOrNot
= Writable
| NotWritable
data CacheType
= Repo
| Directory
data CacheLoc = Cache !CacheType !WritableOrNot !String
newtype Cache = Ca [CacheLoc]
unionCaches :: Cache -> Cache -> Cache
repo2cache :: String -> Cache
cacheHash :: ByteString -> String
okayHash :: String -> Bool
takeHash :: ByteString -> Maybe (String, ByteString)
checkHash :: String -> ByteString -> Bool
findFileMtimeUsingCache :: Cache -> HashedDir -> String -> IO EpochTime
setFileMtimeUsingCache :: Cache -> HashedDir -> String -> EpochTime -> IO ()
fetchFileUsingCache :: Cache -> HashedDir -> String -> IO (String, ByteString)
writable :: CacheLoc -> Bool
hashedFilePath :: CacheLoc -> HashedDir -> String -> String
peekInCache :: Cache -> HashedDir -> String -> IO Bool
speculateFileUsingCache :: Cache -> HashedDir -> String -> IO ()
data OrOnlySpeculate
= ActuallyCopy
| OnlySpeculate
copyFileUsingCache :: OrOnlySpeculate -> Cache -> HashedDir -> String -> IO ()
data FromWhere
= LocalOnly
| Anywhere
fetchFileUsingCachePrivate :: FromWhere -> Cache -> HashedDir -> String -> IO (String, ByteString)
createCache :: CacheLoc -> HashedDir -> IO ()
write :: Compression -> String -> ByteString -> IO ()
writeFileUsingCache :: Cache -> Compression -> HashedDir -> ByteString -> IO String
cleanCaches :: Cache -> HashedDir -> IO ()
cleanCachesWithHint :: Cache -> HashedDir -> [String] -> IO ()
cleanCachesWithHint' :: Cache -> HashedDir -> Maybe [String] -> IO ()
Documentation
data HashedDir
Constructors
HashedPristineDir
HashedPatchesDir
HashedInventoriesDir
hashedDir :: HashedDir -> String
data WritableOrNot
Constructors
Writable
NotWritable
show/hide Instances
data CacheType
Constructors
Repo
Directory
show/hide Instances
data CacheLoc
Constructors
Cache !CacheType !WritableOrNot !String
show/hide Instances
newtype Cache
Constructors
Ca [CacheLoc]
show/hide Instances
Show Cache
unionCaches :: Cache -> Cache -> Cache
repo2cache :: String -> Cache
cacheHash :: ByteString -> String
cacheHash computes the cache hash (i.e. filename) of a packed string.
okayHash :: String -> Bool
takeHash :: ByteString -> Maybe (String, ByteString)
checkHash :: String -> ByteString -> Bool
findFileMtimeUsingCache :: Cache -> HashedDir -> String -> IO EpochTime
setFileMtimeUsingCache :: Cache -> HashedDir -> String -> EpochTime -> IO ()
fetchFileUsingCache :: Cache -> HashedDir -> String -> IO (String, ByteString)
writable :: CacheLoc -> Bool
hashedFilePath :: CacheLoc -> HashedDir -> String -> String
hashedFilePath cachelocation subdir hash returns the physical filename of hash hash in the subdir section of cachelocation.
peekInCache :: Cache -> HashedDir -> String -> IO Bool
peekInCache cache subdir hash tells whether cache and contains an object with hash hash in a writable position. Florent: why do we want it to be in a writable position?
speculateFileUsingCache :: Cache -> HashedDir -> String -> IO ()
speculateFileUsingCache cache subdirectory name takes note that the file name is likely to be useful soon: pipelined downloads will add it to the (low-priority) queue, for the rest it is a noop.
data OrOnlySpeculate
Constructors
ActuallyCopy
OnlySpeculate
show/hide Instances
copyFileUsingCache :: OrOnlySpeculate -> Cache -> HashedDir -> String -> IO ()
data FromWhere
Constructors
LocalOnly
Anywhere
show/hide Instances
fetchFileUsingCachePrivate :: FromWhere -> Cache -> HashedDir -> String -> IO (String, ByteString)
createCache :: CacheLoc -> HashedDir -> IO ()
write :: Compression -> String -> ByteString -> IO ()
write compression filename content writes content to the file filename according to the policy given by compression.
writeFileUsingCache :: Cache -> Compression -> HashedDir -> ByteString -> IO String
writeFileUsingCache cache compression subdir contents write the string contents to the directory subdir, except if it is already in the cache, in which case it is a noop. Warning (?) this means that in case of a hash collision, writing using writeFileUsingCache is a noop. The returned value is the filename that was given to the string.
cleanCaches :: Cache -> HashedDir -> IO ()
cleanCachesWithHint :: Cache -> HashedDir -> [String] -> IO ()
cleanCachesWithHint' :: Cache -> HashedDir -> Maybe [String] -> IO ()
Produced by Haddock version 2.4.2