Skip to content

Commit

Permalink
version 0.1.0.4: Mongo config changed (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ozzzzz committed Apr 25, 2018
1 parent d61baab commit 92781f7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [0.1.0.4] - 2018-04-25
### Changed
- Field `database` changed to `databases` in Mongo config.

## [0.1.0.3] - 2018-04-25
### Added
- Field `database` in Mongo config.
Expand Down
4 changes: 3 additions & 1 deletion bcd-config.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: bcd-config
version: 0.1.0.3
version: 0.1.0.4
synopsis: Library to get config.
description: Library to get config to different systems
homepage: https://github.com/biocad/bcd-config#readme
bug-reports: https://github.com/biocad/bcd-config/issues
Expand Down Expand Up @@ -33,6 +34,7 @@ library
, System.BCD.Config.FileSystem
, System.BCD.Config.BioSources
build-depends: base >=4.7 && <5
, containers
, text
, unordered-containers
, aeson-picker
Expand Down
19 changes: 12 additions & 7 deletions src/System/BCD/Config/Mongo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@ module System.BCD.Config.Mongo
) where

import Data.Aeson.Picker ((|--))
import Data.Map.Strict (Map)
import Data.Text (Text)
import System.BCD.Config (FromJsonConfig (..), getConfigText)

data MongoConfig = MongoConfig { _host :: String
, _port :: Int
, _user :: String
, _password :: String
, _database :: String
, _descr :: String

data MongoConfig = MongoConfig { _host :: String
, _port :: Int
, _user :: String
, _password :: String
, _databases :: Map String Text
, _descr :: String
}
deriving (Show, Read, Eq)



instance FromJsonConfig MongoConfig where
fromJsonConfig = do
jsonText <- getConfigText
Expand All @@ -25,5 +30,5 @@ instance FromJsonConfig MongoConfig where
(get "port")
(get "user")
(get "password")
(get "database")
(get "databases")
(get "descr")

0 comments on commit 92781f7

Please sign in to comment.