split up Types

This commit is contained in:
Joey Hess 2010-10-11 17:19:55 -04:00
parent de3dafae80
commit af82586adf
11 changed files with 49 additions and 55 deletions

View file

@ -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) ++ "\" }"