diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-10-06 13:54:52 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-10-06 13:54:52 -0400 |
commit | b40d441c52f37584653e74fada9906cc8105c9f7 (patch) | |
tree | 737396d6ab61212cad52555c7bc99dedd167b330 /Types | |
parent | 54d3bfbb98958cb49399f1a7f092fa43593ef4c8 (diff) | |
download | keysafe-b40d441c52f37584653e74fada9906cc8105c9f7.tar.gz |
move level from Server to Storage
This allows local storage locations to have levels too, and also get
shuffled nicely.
This commit was sponsored by Ethan Aubin.
Diffstat (limited to 'Types')
-rw-r--r-- | Types/Server.hs | 4 | ||||
-rw-r--r-- | Types/Storage.hs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Types/Server.hs b/Types/Server.hs index 5caf9db..9a2017d 100644 --- a/Types/Server.hs +++ b/Types/Server.hs @@ -27,12 +27,8 @@ newtype ServerName = ServerName { fromServerName :: String } instance ToJSON ServerName instance FromJSON ServerName -data ServerLevel = Recommended | Alternate | Untrusted - deriving (Show, Eq, Ord, Bounded, Enum) - data Server = Server { serverName :: ServerName - , serverLevel :: ServerLevel , serverAddress :: [ServerAddress] -- ^ A server may have multiple addresses, or no current address. , serverDesc :: String diff --git a/Types/Storage.hs b/Types/Storage.hs index d9db853..c83593a 100644 --- a/Types/Storage.hs +++ b/Types/Storage.hs @@ -20,6 +20,9 @@ newtype StorageLocations = StorageLocations [Storage] newtype LocalStorageDirectory = LocalStorageDirectory FilePath +data StorageLevel = LocallyPreferred | Recommended | Alternate | Untrusted + deriving (Show, Eq, Ord, Bounded, Enum) + -- | Storage interface. This can be used both for local storage, -- an upload queue, or a remote server. -- @@ -35,6 +38,7 @@ data Storage = Storage , moveShares :: Storage -> IO [StoreResult] -- ^ Tries to move all shares from this storage to another one. , uploadQueue :: Maybe Storage + , storageLevel :: StorageLevel , getServer :: Maybe Server } |