The hedis-config package

[ Tags: bsd3, database, library ] [ Propose Tags ]

Datatype to parse redis connection settings from file like

host: localhost                 # host name or address
port: 6379                      # you can specify either port
# socket: /run/redis.socket     # or unix socket path
# service: redis                # or service name
password: "pass"                # if not specified then no password used
database: 0                     # database number to connect to
max-connections: 5              # max connections in pool
max-idle-time: 30               # keep connection open for 30 seconds

[Skip to Readme]

Properties

Versions 0.0.1, 0.0.2, 0.0.3
Change log CHANGELOG.md
Dependencies aeson, base (>=4.6 && <5), bytestring, hedis (>=0.6), scientific, text, time [details]
License BSD3
Author Aleksey Uimanov
Maintainer s9gf4ult@gmail.com
Category Database
Home page https://bitbucket.org/s9gf4ult/hedis-config
Source repository head: git clone git@bitbucket.org:s9gf4ult/hedis-config.git
Uploaded Wed Feb 24 05:37:49 UTC 2016 by AlekseyUymanov
Distributions NixOS:0.0.3
Downloads 386 total (12 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-02-24 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for hedis-config-0.0.3

[back to package description]

How

Just copy this

host: localhost                 # host name or address
port: 6379                      # you can specify either port
# socket: /run/redis.socket     # or unix socket path
# service: redis                # or service name
password: "pass"                # if not specified then no password used
database: 0                     # database number to connect to
max-connections: 5              # max connections in pool
max-idle-time: 30               # keep connection open for 30 seconds

to your config file, then

import Data.Yaml
import Database.Redis.Config

main :: IO ()
main = do
    conn <- decodeFile "config/redis.yml" >>= \case
        Nothing -> fail "Could not parse redis.conf"
        Just conf -> connectRedis conf
    run conn

Thats all, you already working with Redis connection