diff options
Diffstat (limited to 'Storage')
-rw-r--r-- | Storage/Local.hs (renamed from Storage/LocalFiles.hs) | 6 | ||||
-rw-r--r-- | Storage/Network.hs | 33 |
2 files changed, 36 insertions, 3 deletions
diff --git a/Storage/LocalFiles.hs b/Storage/Local.hs index ebcc492..93647df 100644 --- a/Storage/LocalFiles.hs +++ b/Storage/Local.hs @@ -5,7 +5,7 @@ {-# LANGUAGE OverloadedStrings #-} -module Storage.LocalFiles (localFiles) where +module Storage.Local (localStorage) where import Types import Storage @@ -23,8 +23,8 @@ import Raaz.Core.Encode import Control.DeepSeq import Control.Exception -localFiles :: Storage -localFiles = Storage +localStorage :: Storage +localStorage = Storage { storeShard = store , retrieveShard = retrieve , obscureShards = obscure diff --git a/Storage/Network.hs b/Storage/Network.hs new file mode 100644 index 0000000..06b7545 --- /dev/null +++ b/Storage/Network.hs @@ -0,0 +1,33 @@ +{- Copyright 2016 Joey Hess <id@joeyh.name> + - + - Licensed under the GNU AGPL version 3 or higher. + -} + +{-# LANGUAGE OverloadedStrings #-} + +module Storage.Network (networkStorage) where + +import Types +import Storage + +networkStorage :: Storage +networkStorage = Storage + { storeShard = store + , retrieveShard = retrieve + , obscureShards = obscure + , countShards = count + } + +store :: StorableObjectIdent -> Shard -> IO StoreResult +store _i _s = return $ StoreFailure "network storage not implemented yet" + +retrieve :: ShardNum -> StorableObjectIdent -> IO RetrieveResult +retrieve _n _i = return $ RetrieveFailure "network storage not implemented yet" + +-- | Servers should automatically obscure, so do nothing. +-- (Could upload chaff.) +obscure :: IO ObscureResult +obscure = return ObscureSuccess + +count :: IO CountResult +count = return $ CountFailure "network storage not implemented yet" |