aboutsummaryrefslogtreecommitdiff
path: root/Types/Backend.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-07-27 12:33:46 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-07-27 12:33:46 -0400
commit300935948503d671ad91b943787d71dc1f6e421e (patch)
tree9452b227b121f30e7c89fd87cc3756cd34769357 /Types/Backend.hs
parentc7f90efb8626573f2e2927195ce16cb609fac315 (diff)
add key stability checking interface
Needed for resuming from chunks. Url keys are considered not stable. I considered treating url keys with a known size as stable, but just don't feel that is enough information.
Diffstat (limited to 'Types/Backend.hs')
-rw-r--r--Types/Backend.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Types/Backend.hs b/Types/Backend.hs
index 7eb59b6e2..5c5855bc3 100644
--- a/Types/Backend.hs
+++ b/Types/Backend.hs
@@ -15,9 +15,16 @@ import Types.KeySource
data BackendA a = Backend
{ name :: String
, getKey :: KeySource -> a (Maybe Key)
+ -- Checks the content of a key.
, fsckKey :: Maybe (Key -> FilePath -> a Bool)
+ -- Checks if a key can be upgraded to a better form.
, canUpgradeKey :: Maybe (Key -> Bool)
+ -- Checks if there is a fast way to migrate a key to a different
+ -- backend (ie, without re-hashing).
, fastMigrate :: Maybe (Key -> BackendA a -> Maybe Key)
+ -- Checks if a key is known (or assumed) to always refer to the
+ -- same data.
+ , isStableKey :: Key -> Bool
}
instance Show (BackendA a) where