keysafe-0.20160819: Storage/Network.hs
{- Copyright 2016 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU AGPL version 3 or higher.
-}
{-# LANGUAGE OverloadedStrings #-}
module Storage.Network (Server(..), networkServers, networkStorage) where
import Types
import Types.Storage
newtype Server = Server { serverName :: String }
networkServers :: IO [Server]
networkServers = return [] -- none yet
networkStorage :: Server -> Storage
networkStorage server = Storage
{ storeShare = store server
, retrieveShare = retrieve server
, obscureShares = obscure server
, countShares = count server
, moveShares = move server
}
store :: Server -> StorableObjectIdent -> Share -> IO StoreResult
store _server _i _s = return $ StoreFailure "network storage not implemented yet"
retrieve :: Server -> ShareNum -> StorableObjectIdent -> IO RetrieveResult
retrieve _server _n _i = return $ RetrieveFailure "network storage not implemented yet"
-- | Servers should automatically obscure, so do nothing.
-- (Could upload chaff.)
obscure :: Server -> IO ObscureResult
obscure _ = return ObscureSuccess
count :: Server -> IO CountResult
count _server = return $ CountFailure "network storage not implemented yet"
-- | Not needed for servers.
move :: Server -> Storage -> IO ()
move _ _ = return ()