diff options
author | Joey Hess <joey@kitenet.net> | 2010-10-11 17:19:55 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-10-11 17:19:55 -0400 |
commit | af82586adff96f18fe768e432f501c647401262f (patch) | |
tree | 20e7ec170661ab11010e39ce46657b69e7341e09 /Backend.hs | |
parent | de3dafae80f45af8db56dc95e11863f049cf3cb2 (diff) |
split up Types
Diffstat (limited to 'Backend.hs')
-rw-r--r-- | Backend.hs | 18 |
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) ++ "\" }" |