diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-08-20 17:28:19 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-08-20 17:32:55 -0400 |
commit | 3633c44893bfbd50f25b84ac353012975388332c (patch) | |
tree | df4ee463ce728fc58214b1e20ce23f48a4e71e60 /Types | |
parent | e6097d694ca24b9546f9b7b25fc73768af9f017b (diff) | |
download | keysafe-3633c44893bfbd50f25b84ac353012975388332c.tar.gz |
initial http api using servant
Diffstat (limited to 'Types')
-rw-r--r-- | Types/Storage.hs | 13 |
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 |