hedis-config: Easy trivial configuration for Redis

[ bsd3, database, library ] [ Propose Tags ] [ Report a vulnerability ]

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
timeout: 30                     # connection timeout

[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.1, 0.0.2, 0.0.3, 1.0.0
Change log CHANGELOG.md
Dependencies aeson, base (>=4.6 && <5), bytestring, hedis (>=0.9.12), scientific, text, time [details]
License BSD-3-Clause
Author Aleksey Uimanov
Maintainer s9gf4ult@gmail.com
Category Database
Home page https://bitbucket.org/s9gf4ult/hedis-config
Source repo head: git clone git@bitbucket.org:s9gf4ult/hedis-config.git
Uploaded by AlekseyUymanov at 2018-04-22T14:41:28Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 2971 total (16 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-04-22 [all 1 reports]

Readme for hedis-config-1.0.0

[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
timeout: 30                     # connection timeout

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