GithubHelp home page GithubHelp logo

pandora.consul's Introduction

Pandora aims to externalize the application configuration. Usually in .NET projects the configuration is done in app/web.config with transformations.

The problem arises when production configuration is needed which should not be part of the application repository because it is an OSS project for example. This is where Pandora comes. You can configure the application using the following structure and store these files in a separate repository:

ReferenceConfiguration.json

{
    "name": "ReferenceConfiguration",
    "defaults": {
        "refSetting0": "refSetting0",
        "refSetting1": "refSetting1",
        "refSetting2": "refSetting2"
    },
    "clusters": {
        "local": {
            "refSetting0": "int_refSetting0",
            "refSetting1": "int_refSetting1",
            "refSetting2": "int_refSetting2"
        },
        "test": {
            "refSetting0": "test_refSetting0",
            "refSetting1": "test_refSetting1",
            "refSetting2": "test_refSetting2"
        }
    },
    "machines": {
        "COMPUTERNAME": {
            "refSetting0": "machine_refSetting0"
        }
    }
}

SampleConfiguration.json

{
    "name": "SampleConfiguration",
    "references": [
        { "jar": "ReferenceConfiguration.json" }
    ],
    "defaults": {
        "setting0": "setting0",
        "setting1": "setting1",
        "setting2": "setting2"
    },
    "clusters": {
        "local": {
            "setting0": "int_setting0",
            "setting1": "int_setting1",
            "setting2": "int_setting2"
        },
        "test": {
            "setting0": "test_setting0",
            "setting1": "test_setting1",
            "setting2": "test_setting2"
        }
    }
    "machines": {
        "COMPUTERNAME": {
            "cluster": "local"
            "setting0": "int_setting0",
            "setting1": "int_setting1",
            "setting2": "int_setting2"
        }
    }
}
  • jar file: this is the file containing configuration. In this case SampleConfiguration.json
  • name: The application name. The recommended approach is to name the jar file with the same name
  • defaults: defines configuration keys for the current application and sets default values
  • clusters: defines different environment configurations where the application will be deployed. Here local is the dev environment and test is the place for QA
  • machines: defines configurations for specific machine inside a cluster. The COMPUTERNAME is the default ENV VAR in windows.
  • references: merges two jar files. Same rules apply here. You are not allowed to have the duplicate keys in ref and main jars

In order to install the configurations you will have to use Pandora.Cli. By default the configurations are applied and stored in environment variables.

pandora.consul's People

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

mallickhruday

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.