summaryrefslogtreecommitdiff
path: root/Types
diff options
context:
space:
mode:
Diffstat (limited to 'Types')
-rw-r--r--Types/Availability.hs11
-rw-r--r--Types/GitConfig.hs3
-rw-r--r--Types/Remote.hs14
3 files changed, 25 insertions, 3 deletions
diff --git a/Types/Availability.hs b/Types/Availability.hs
new file mode 100644
index 000000000..f8c8ea3f3
--- /dev/null
+++ b/Types/Availability.hs
@@ -0,0 +1,11 @@
+{- git-annex remote availability
+ -
+ - Copyright 2014 Joey Hess <joey@kitenet.net>
+ -
+ - Licensed under the GNU GPL version 3 or higher.
+ -}
+
+module Types.Availability where
+
+data Availability = GloballyAvailable | LocallyAvailable
+ deriving (Eq, Show, Read)
diff --git a/Types/GitConfig.hs b/Types/GitConfig.hs
index 8623258a1..cda53f229 100644
--- a/Types/GitConfig.hs
+++ b/Types/GitConfig.hs
@@ -18,6 +18,7 @@ import qualified Git.Config
import Utility.DataUnits
import Config.Cost
import Types.Distribution
+import Types.Availability
{- Main git-annex settings. Each setting corresponds to a git-config key
- such as annex.foo -}
@@ -101,6 +102,7 @@ data RemoteGitConfig = RemoteGitConfig
, remoteAnnexTrustLevel :: Maybe String
, remoteAnnexStartCommand :: Maybe String
, remoteAnnexStopCommand :: Maybe String
+ , remoteAnnexAvailability :: Maybe Availability
{- These settings are specific to particular types of remotes
- including special remotes. -}
@@ -130,6 +132,7 @@ extractRemoteGitConfig r remotename = RemoteGitConfig
, remoteAnnexTrustLevel = notempty $ getmaybe "trustlevel"
, remoteAnnexStartCommand = notempty $ getmaybe "start-command"
, remoteAnnexStopCommand = notempty $ getmaybe "stop-command"
+ , remoteAnnexAvailability = getmayberead "availability"
, remoteAnnexSshOptions = getoptions "ssh-options"
, remoteAnnexRsyncOptions = getoptions "rsync-options"
diff --git a/Types/Remote.hs b/Types/Remote.hs
index 8a94dcc05..2a02d99aa 100644
--- a/Types/Remote.hs
+++ b/Types/Remote.hs
@@ -2,12 +2,19 @@
-
- Most things should not need this, using Types instead
-
- - Copyright 2011 Joey Hess <joey@kitenet.net>
+ - Copyright 2011-2014 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
-module Types.Remote where
+module Types.Remote
+ ( RemoteConfigKey
+ , RemoteConfig
+ , RemoteTypeA(..)
+ , RemoteA(..)
+ , Availability(..)
+ )
+ where
import Data.Map as M
import Data.Ord
@@ -16,6 +23,7 @@ import qualified Git
import Types.Key
import Types.UUID
import Types.GitConfig
+import Types.Availability
import Config.Cost
import Utility.Metered
import Git.Types
@@ -82,7 +90,7 @@ data RemoteA a = Remote {
-- a Remote can be known to be readonly
readonly :: Bool,
-- a Remote can be globally available. (Ie, "in the cloud".)
- globallyAvailable :: Bool,
+ availability :: Availability,
-- the type of the remote
remotetype :: RemoteTypeA a
}