wip
This commit is contained in:
parent
6767813879
commit
c45ea0ecc8
26
backend/src/Configuration.hs
Normal file
26
backend/src/Configuration.hs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{-# Language NoImplicitPrelude #-}
|
||||||
|
{-# Language DeriveGeneric #-}
|
||||||
|
{-# Language DuplicateRecordFields #-}
|
||||||
|
module Configuration where
|
||||||
|
|
||||||
|
import ClassyPrelude
|
||||||
|
import Dhall (Interpret)
|
||||||
|
|
||||||
|
data Pg = Pg { username :: Text
|
||||||
|
, password :: Text
|
||||||
|
, host :: Text
|
||||||
|
, database :: Text }
|
||||||
|
deriving (Show, Generic)
|
||||||
|
|
||||||
|
data Store = Filestore { path :: Text }
|
||||||
|
| IPFS { common :: Text }
|
||||||
|
deriving (Show, Generic)
|
||||||
|
|
||||||
|
data Config = Config { database :: Pg
|
||||||
|
, store :: Store }
|
||||||
|
deriving (Show, Generic)
|
||||||
|
|
||||||
|
instance Interpret Pg
|
||||||
|
instance Interpret Store
|
||||||
|
instance Interpret Config
|
||||||
|
|
@ -29,19 +29,19 @@ library
|
|||||||
, RecordWildCards
|
, RecordWildCards
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
||||||
test-suite spec
|
-- test-suite spec
|
||||||
type: exitcode-stdio-1.0
|
-- type: exitcode-stdio-1.0
|
||||||
main-is: Spec.hs
|
-- main-is: Spec.hs
|
||||||
hs-source-dirs: src
|
-- hs-source-dirs: src
|
||||||
build-depends: base >=4.10
|
-- build-depends: base >=4.10
|
||||||
, classy-prelude
|
-- , classy-prelude
|
||||||
, foreign-store
|
-- , foreign-store
|
||||||
, generic-lens
|
-- , generic-lens
|
||||||
, lens
|
-- , lens
|
||||||
, mtl
|
-- , mtl
|
||||||
, text
|
-- , text
|
||||||
, transformers
|
-- , transformers
|
||||||
, validity
|
-- , validity
|
||||||
, genvalidity-hspec
|
-- , genvalidity-hspec
|
||||||
, genvalidity-property
|
-- , genvalidity-property
|
||||||
, hspec
|
-- , hspec
|
||||||
|
Loading…
Reference in New Issue
Block a user