Giter Site home page Giter Site logo

oubiwann / lcmap-config Goto Github PK

View Code? Open in Web Editor NEW

This project forked from repository-preservation/lcmap-config

0.0 2.0 0.0 146 KB

Consolidated Configuration for all Clojure-based LCMAP Components [alpha 0.5.0]

License: Other

Makefile 29.15% Clojure 68.86% Shell 1.99%

lcmap-config's Introduction

lcmap.config

Build StatusClojars Project

Unified Configuration for the LCMAP System of Systems

LCMAP open source project logo

Contents

About

This project provides helpers to parse, coerce, and validate values from a variety of sources (INI, EDN, CLI, ENV). It also supplies configuration component in order to make it easy to supply other components with configuration values..

Documentation

The LCMAP configuration system API reference is slowly being updated with docstrings. The project's auto-generated documentation is available here:

Usage

In order to use lcmap-config you need to:

  1. Add a dependency to project.clj
  2. Define a schema to coerce and validate values
  3. Add keys/values to lcmap.ini
  4. Update your components

project.clj Dependency

[lcmap-config 0.5.0-SNAPSHOT]

Defining a Config Schema

For example:

(ns lcmap.project.config)

(def cfg-schema
  {schema/Keyword schema/Any})

(def defaults
  {:ini *lcmap-config-ini*
   :args *command-line-args*
   :schema cfg-schema})

Configuration File

By default LCMAP projects read configuration from $HOME/.usgs/lcmap.ini.

The convention is to create a section based on the project's namespace. For example, the lcmap-data project expects a section called lcmap.data:

[lcmap.data]
db-hosts=host1, host2, host3

Components & Configuration

LCMAP projects expect the configuration component to be associated with a key of :cfg in the system map.

(component/system-map
  ...
  :cfg (component/using
         (config/new-configuration opts)
          []))
  ...)

Use the first and second level namespace ... wording ... e.g. lcmap.data, lcmap.rest, lcmap.client, etc.

License

Copyright © 2015-2016 United States Government

NASA Open Source Agreement, Version 1.3

lcmap-config's People

Contributors

oubiwann avatar jmorton avatar davidvhill avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.