summaryrefslogtreecommitdiffhomepage
path: root/Types/Storage.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Types/Storage.hs')
-rw-r--r--Types/Storage.hs13
1 files changed, 10 insertions, 3 deletions
diff --git a/Types/Storage.hs b/Types/Storage.hs
index 01ae0ad..5032949 100644
--- a/Types/Storage.hs
+++ b/Types/Storage.hs
@@ -4,10 +4,13 @@
-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE DeriveGeneric #-}
module Types.Storage where
import Types
+import GHC.Generics
+import Data.Aeson.Types
-- | All known locations where shares can be stored, ordered with
-- preferred locations first.
@@ -31,12 +34,16 @@ data Storage = Storage
}
data StoreResult = StoreSuccess | StoreAlreadyExists | StoreFailure String
- deriving (Show)
+ deriving (Show, Generic)
data RetrieveResult = RetrieveSuccess Share | RetrieveFailure String
+ deriving (Generic)
data ObscureResult = ObscureSuccess | ObscureFailure String
- deriving (Show)
+ deriving (Show, Generic)
data CountResult = CountResult Integer | CountFailure String
- deriving (Show)
+ deriving (Show, Generic)
+
+instance ToJSON StoreResult
+instance ToJSON CountResult