Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/narkisr/formation
A configuration library for Clojure
https://github.com/narkisr/formation
Last synced: 12 days ago
JSON representation
A configuration library for Clojure
- Host: GitHub
- URL: https://github.com/narkisr/formation
- Owner: narkisr
- Created: 2014-04-21T17:56:52.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-04-30T15:10:24.000Z (over 7 years ago)
- Last Synced: 2024-11-28T22:11:42.356Z (27 days ago)
- Language: Clojure
- Size: 5.86 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Intro
Formation is a configuration library for Clojure projects following simple conventions, it enables:* Loading edn files from ~/.{project}.edn or /etc/{project}/{project}.edn (by order).
* Running [validations](https://github.com/narkisr/substantiation) on the configuration.
* Spitting out errors in pretty printed form into both stdout/[timbre](https://github.com/ptaoussanis/timbre).[![Build Status](https://travis-ci.org/narkisr/formation.png)](https://travis-ci.org/narkisr/formation)
# Usage
Formation expects the following keys in the edn file (for project named foo):```clojure
{
:foo {
:log {:path "/var/log/foo.log"}
}
}
```Loading and validating:
```clojure
(defn validate [c]
; using any validation framework with structured error output
)
(config "foo" validate)
```# Copyright and license
Copyright [2017] [Ronen Narkis]Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.