conskit / ck.config

Configuration module for Conskit that adds environment variable support to trapperkeeper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ck.config Build Status Dependencies Status Clojars Project

Configuration module for conskit

Installation

Add the dependency in the clojars badge above in your project.clj.

Usage

Add the following to your bootstrap.cfg:

ck.config/config-service

Add the dependency in your serivice and call the get-in-config method where needed.

(defservice
  my-service
  [[:EnvironmentConfigService register-hanlder!]]
  (init [this context]
    ...
    (get-in-config [:some :config :keys])
  ...))

get-in-config works similar to what is provided by TrapperKeeper's :ConfigService but adds support for environment variables. Any configuration string value prefixed with "ENV_" will be treated as an environment variable and resolved once the service initializes

License

Copyright © 2016 Jason Murphy

Distributed under the Apache License, Version 2.0.

About

Configuration module for Conskit that adds environment variable support to trapperkeeper


Languages

Language:Clojure 100.0%