Skip to content

Instantly share code, notes, and snippets.

@bbbates
Created December 29, 2013 05:15
Show Gist options
  • Select an option

  • Save bbbates/8167675 to your computer and use it in GitHub Desktop.

Select an option

Save bbbates/8167675 to your computer and use it in GitHub Desktop.
Confijulate example configuration namespace
(ns
^:cfj-config
example.config
(:require [confijulate.core :as cfj]))
(def ^:cfj-base base-config
{:db
{:classname "net.sf.log4jdbc.DriverSpy"
:subprotocol "log4jdbc"
:subname "postgresql:example"
:user "example"
:password "example"
:delimiters ""}
:jobs
{:enable-schedule false ;;disabled by default
:process-registration {:cron "00 * * * * ?"}
:alerts-immediate {:cron "00 * * * * ?"}
:alerts-frequent {:cron "00 00 * * * ?"}
:alerts-infrequent {:cron "00 00 10 * * ?"}}})
(def ^{:cfj-env "test"} test-config
{
:db
{:subname "postgresql://some-server.example.com/example"
:password "password"}
:jobs
{
:enable-schedule true}})
(def ^{:cfj-env "prod"} test-config
{
:db
{:subname "postgresql://some-prod-server.example.com/example"
:password "strong-password"}
:jobs
{
:enable-schedule true
:alerts-frequent {:cron "00 0/5 * * ?"}}})
(def get-cfg cfj/get-cfg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment