https://github.com/narkisr/formation
A configuration library for Clojure
https://github.com/narkisr/formation
Last synced: 8 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 (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-04-30T15:10:24.000Z (about 8 years ago)
- Last Synced: 2025-03-30T18:23:52.313Z (3 months ago)
- Language: Clojure
- Size: 5.86 KB
- Stars: 3
- Watchers: 1
- 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).[](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.