mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-14 05:08:29 +01:00
BackupToS3
This commit is contained in:
parent
621bbff4bc
commit
e33356107b
@ -6,6 +6,7 @@ module Data.BlobStore
|
||||
, storeWrite
|
||||
, storeRead
|
||||
, storeExists
|
||||
, BackupToS3 (..)
|
||||
) where
|
||||
|
||||
import ClassyPrelude.Yesod
|
||||
@ -97,7 +98,7 @@ cachedS3Store :: (BackupToS3 key, ToPath key)
|
||||
cachedS3Store cache bucket prefix = BlobStore
|
||||
{ storeWrite' = \key ->
|
||||
}
|
||||
-}
|
||||
|
||||
class BackupToS3 key where
|
||||
shouldBackup :: key -> Bool
|
||||
-}
|
||||
|
||||
10
Types.hs
10
Types.hs
@ -1,7 +1,7 @@
|
||||
module Types where
|
||||
|
||||
import ClassyPrelude.Yesod
|
||||
import Data.BlobStore (ToPath (..))
|
||||
import Data.BlobStore (ToPath (..), BackupToS3 (..))
|
||||
import Text.Blaze (ToMarkup)
|
||||
import Database.Persist.Sql (PersistFieldSql (sqlType))
|
||||
import qualified Data.Text as T
|
||||
@ -70,6 +70,14 @@ instance ToPath StoreKey where
|
||||
, toPathPiece viewName
|
||||
, "00-index.tar.gz"
|
||||
]
|
||||
instance BackupToS3 StoreKey where
|
||||
shouldBackup HackageCabal{} = False
|
||||
shouldBackup HackageSdist{} = False
|
||||
shouldBackup CabalIndex{} = True
|
||||
shouldBackup CustomSdist{} = True
|
||||
shouldBackup HackageViewCabal{} = False
|
||||
shouldBackup HackageViewSdist{} = False
|
||||
shouldBackup HackageViewIndex{} = False
|
||||
|
||||
newtype HackageRoot = HackageRoot { unHackageRoot :: Text }
|
||||
deriving (Show, Read, Typeable, Eq, Ord, Hashable, PathPiece, ToMarkup)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user