diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-10-08 15:01:38 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-10-08 15:01:38 -0400 |
commit | 55fb90edfc8732b08bea9239a6f4a471ac7867c3 (patch) | |
tree | 4f6933ac0c8aec8d7344b6248521ae338db23261 /Types | |
parent | 8152051fcdbdadf43b70420add5bcc2f2c118b9c (diff) |
add removeKey action to Remote
Not implemented for any remotes yet; probably the git remote is the only
one that will ever implement it.
Diffstat (limited to 'Types')
-rw-r--r-- | Types/Remote.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Types/Remote.hs b/Types/Remote.hs index 24851e17c..1bf79a81e 100644 --- a/Types/Remote.hs +++ b/Types/Remote.hs @@ -7,6 +7,8 @@ - Licensed under the GNU GPL version 3 or higher. -} +{-# LANGUAGE RankNTypes #-} + module Types.Remote ( RemoteConfigKey , RemoteConfig @@ -72,8 +74,12 @@ data RemoteA a = Remote { -- Retrieves a key's contents to a tmp file, if it can be done cheaply. -- It's ok to create a symlink or hardlink. retrieveKeyFileCheap :: Key -> AssociatedFile -> FilePath -> a Bool, - -- removes a key's contents (succeeds if the contents are not present) + -- Removes a key's contents (succeeds if the contents are not present) removeKey :: Key -> a Bool, + -- Uses locking to prevent removal of a key's contents, + -- and runs the passed action while it's locked. + -- This is optional; remotes do not have to support locking. + lockContent :: forall r. Maybe (Key -> a r -> a r), -- Checks if a key is present in the remote. -- Throws an exception if the remote cannot be accessed. checkPresent :: Key -> a Bool, |