From 41bfb68ee296a4ecdcbd9c02d242d6c9e149b7b8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 17 Aug 2016 15:23:00 -0400 Subject: make storage to use configurable on command line --- Storage/Network.hs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Storage/Network.hs (limited to 'Storage/Network.hs') 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 + - + - 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" -- cgit v1.2.3