split up Types
This commit is contained in:
parent
de3dafae80
commit
af82586adf
11 changed files with 49 additions and 55 deletions
18
Backend.hs
18
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) ++ "\" }"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue