module Hackage.Security.TUF.Layout.Cache (
CacheLayout(..)
, cabalCacheLayout
) where
import Prelude
import Hackage.Security.TUF.Paths
import Hackage.Security.Util.Path
data CacheLayout = CacheLayout {
CacheLayout -> CachePath
cacheLayoutRoot :: CachePath
, CacheLayout -> CachePath
cacheLayoutTimestamp :: CachePath
, CacheLayout -> CachePath
cacheLayoutSnapshot :: CachePath
, CacheLayout -> CachePath
cacheLayoutMirrors :: CachePath
, CacheLayout -> CachePath
cacheLayoutIndexTar :: CachePath
, CacheLayout -> CachePath
cacheLayoutIndexIdx :: CachePath
, CacheLayout -> CachePath
cacheLayoutIndexTarGz :: CachePath
}
cabalCacheLayout :: CacheLayout
cabalCacheLayout :: CacheLayout
cabalCacheLayout = CacheLayout {
cacheLayoutRoot :: CachePath
cacheLayoutRoot = Path Unrooted -> CachePath
rp (Path Unrooted -> CachePath) -> Path Unrooted -> CachePath
forall a b. (a -> b) -> a -> b
$ String -> Path Unrooted
fragment String
"root.json"
, cacheLayoutTimestamp :: CachePath
cacheLayoutTimestamp = Path Unrooted -> CachePath
rp (Path Unrooted -> CachePath) -> Path Unrooted -> CachePath
forall a b. (a -> b) -> a -> b
$ String -> Path Unrooted
fragment String
"timestamp.json"
, cacheLayoutSnapshot :: CachePath
cacheLayoutSnapshot = Path Unrooted -> CachePath
rp (Path Unrooted -> CachePath) -> Path Unrooted -> CachePath
forall a b. (a -> b) -> a -> b
$ String -> Path Unrooted
fragment String
"snapshot.json"
, cacheLayoutMirrors :: CachePath
cacheLayoutMirrors = Path Unrooted -> CachePath
rp (Path Unrooted -> CachePath) -> Path Unrooted -> CachePath
forall a b. (a -> b) -> a -> b
$ String -> Path Unrooted
fragment String
"mirrors.json"
, cacheLayoutIndexTar :: CachePath
cacheLayoutIndexTar = Path Unrooted -> CachePath
rp (Path Unrooted -> CachePath) -> Path Unrooted -> CachePath
forall a b. (a -> b) -> a -> b
$ String -> Path Unrooted
fragment String
"00-index.tar"
, cacheLayoutIndexIdx :: CachePath
cacheLayoutIndexIdx = Path Unrooted -> CachePath
rp (Path Unrooted -> CachePath) -> Path Unrooted -> CachePath
forall a b. (a -> b) -> a -> b
$ String -> Path Unrooted
fragment String
"00-index.tar.idx"
, cacheLayoutIndexTarGz :: CachePath
cacheLayoutIndexTarGz = Path Unrooted -> CachePath
rp (Path Unrooted -> CachePath) -> Path Unrooted -> CachePath
forall a b. (a -> b) -> a -> b
$ String -> Path Unrooted
fragment String
"00-index.tar.gz"
}
where
rp :: Path Unrooted -> CachePath
rp :: Path Unrooted -> CachePath
rp = Path Unrooted -> CachePath
forall root. Path Unrooted -> Path root
rootPath