A minimalistic edn-based configuration file handler
Clojure
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example-resources
src/gorillalabs
test/gorillalabs
.gitignore
.travis.yml
README.md
project.clj

README.md

Gorillalabs/Config

Config is a Clojure config file handler.

Project Goals

Simplify configuration handling.

Project Maturity

config is young, but in use at our own projects.

Artifacts

... artifacts are released to Clojars. If you are using Maven, add the following repository definition to your pom.xml:

<repository>
  <id>clojars.org</id>
  <url>http://clojars.org/repo</url>
</repository>

The Most Recent Release

With Leiningen:

[gorillalabs/config "1.0.2"]

With Maven:

<dependency>
  <groupId>gorillalabs</groupId>
  <artifactId>config</artifactId>
  <version>1.0.2</version>
</dependency>

Documentation & Examples

Our documentation site is not yet live, sorry.

Basically, it lets you read a config file to produce a Clojure map. The config files themselves can contain one or more forms, each of which can be either a map or a list. Maps are simply merged. Lists correspond to invocations of extension points, which in turn produces a map, which is merged along with everything else.

A sample config file could look like this (see "/example-resources" in our project)

(include "config/config.edn")
(include "config/db.TEST.edn")

{:env :local
 :another-key {:map true
               :map-2 42}
 }

As you see, you can include other files.

Read the config using this in your code:

(gorillalabs.config/init)

to read "config.edn" from the classpath

or

(gorillalabs.config/init "ENV")

to read "config@ENV.edn" from the classpath.

If you do not want to store your config on the classpath, just include a reference to a specific file in your config.edn file like this

    (include "file:///external/config/some-config.edn")

Community & Support

Gorillalabs is on twitter @gorillalabs_de: Feel free to join it and ask any questions you may have. We also post announcements of releases, important changes and so on, please follow.

Supported Clojure versions

config is built from the ground up for Clojure 1.5.1 and up.

Continuous Integration Status

Continuous Integration status

Development

config uses Leiningen 2. Make sure you have it installed and then run tests against supported Clojure versions using

lein all test

Then create a branch and make your changes on it. Once you are done with your changes and all tests pass, submit a pull request on GitHub.

License

Copyright (C) 2015 Dr. Christian Betz

Licensed under the Eclipse Public License (the same as Clojure).