9f1577f746
The only remaining vestiage of backends is different types of keys. These are still called "backends", mostly to avoid needing to change user interface and configuration. But everything to do with storing keys in different backends was gone; instead different types of remotes are used. In the refactoring, lots of code was moved out of odd corners like Backend.File, to closer to where it's used, like Command.Drop and Command.Fsck. Quite a lot of dead code was removed. Several data structures became simpler, which may result in better runtime efficiency. There should be no user-visible changes.
27 lines
616 B
Haskell
27 lines
616 B
Haskell
{- git-annex key/value backend data type
|
|
-
|
|
- Most things should not need this, using Types instead
|
|
-
|
|
- Copyright 2010 Joey Hess <joey@kitenet.net>
|
|
-
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
-}
|
|
|
|
module Types.Backend where
|
|
|
|
import Types.Key
|
|
|
|
data Backend a = Backend {
|
|
-- name of this backend
|
|
name :: String,
|
|
-- converts a filename to a key
|
|
getKey :: FilePath -> a (Maybe Key),
|
|
-- called during fsck to check a key
|
|
fsckKey :: Key -> a Bool
|
|
}
|
|
|
|
instance Show (Backend a) where
|
|
show backend = "Backend { name =\"" ++ name backend ++ "\" }"
|
|
|
|
instance Eq (Backend a) where
|
|
a == b = name a == name b
|