Skip to content

flyingmachine/config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

config

Creates a config function which just wraps a map and makes it a a little easier to access its nested values. I use it with environ.

Examples

(ns com.flyingmachine.config-test
  (:use midje.sweet)
  (:require [com.flyingmachine.config :as config]))

(def env {:a {:b {:c :d}}})

;; Create config function around nested map value
(config/defconfig config1 env :a)
;; Create config function around entire map
(config/defconfig config2 env)

(fact "config function with no args returns map"
  (config1) => {:b {:c :d}}
  (config2) => env)

(fact "config function works like applied get-in"
  (config1 :b :c) => :d)

(fact "config function accepts an override map"
  (config1 {:b :e} :b) => :e)

About

library for working with a central config

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published