summaryrefslogtreecommitdiff
path: root/Backend.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Backend.hs')
-rw-r--r--Backend.hs18
1 files changed, 17 insertions, 1 deletions
diff --git a/Backend.hs b/Backend.hs
index eb4a948c4..fb7d5666f 100644
--- a/Backend.hs
+++ b/Backend.hs
@@ -22,7 +22,23 @@ import System.Directory
import Locations
import GitRepo
import Utility
-import Types
+
+-- annexed filenames are mapped into keys
+type Key = FilePath
+
+-- this structure represents a key/value backend
+data Backend = Backend {
+ -- name of this backend
+ name :: String,
+ -- converts a filename to a key
+ getKey :: GitRepo -> FilePath -> IO (Maybe Key),
+ -- stores a file's contents to a key
+ storeFileKey :: GitRepo -> FilePath -> Key -> IO Bool,
+ -- retrieves a key's contents to a file
+ retrieveKeyFile :: Key -> FilePath -> IO Bool,
+ -- removes a key
+ removeKey :: Key -> IO Bool
+}
instance Show Backend where
show backend = "Backend { name =\"" ++ (name backend) ++ "\" }"