Giter VIP home page Giter VIP logo

justflagit's Introduction

FlagIt

Multi language feature flags framework.

Say you have a json describing a feature:

{
    "feature1": {
        "enabled": true,
        "enabled_for" : ["robert", "john"],
        "disabled_for" : ["andrea", "kelly"]
    }
}

Lets say you upload above json to random http service at location:

https://www.example.com/hello/my-lovely-flags

Now you can:

Python

    from flagit import FlagIt

    flag_obj = FlagIt('https://www.example.com/hello/my-lovely-flags')

    # Default value
    assert flag_obj.enabled('feature1')
    assert flag_obj.enabled('feature2') is False

    # Inclusion list
    assert flag_obj.enabled_for('feature1', 'john')
    assert flag_obj.enabled_for('feature1', 'alex') is False

    # Exclusion list
    assert flag_obj.disabled_for('feature1', 'john') is False
    assert flag_obj.disabled_for('feature1', 'alex') is False
    assert flag_obj.disabled_for('feature1', 'kelly')
    assert flag_obj.disabled_for('feature1', 'andrea')

C++

    flagit::FlagIt flags("https://www.example.com/hello/my-lovely-flags");

    # Default value
    REQUIRE(flags.enabled("feature1"));
    REQUIRE_FALSE(flags.enabled("feature2"));

    # Inclusion list
    REQUIRE(flags.enabledFor("feature1", "john"));
    REQUIRE_FALSE(flags.enabledFor("feature1", "alex"));

    # Exclusion list
    REQUIRE_FALSE(flags.disabledFor("feature1", "john"));
    REQUIRE_FALSE(flags.disabledFor("feature1", "alex"));
    REQUIRE(flags.disabledFor("feature1", "kelly"));
    REQUIRE(flags.disabledFor("feature1", "andrea"));

Java In progres..

justflagit's People

Contributors

zokir avatar

Watchers

 avatar

justflagit's Issues

Allow clients overwrite data fetcher

Right now we simply use libcurl to fetch remote src with negotiate.
This might not work if clients need to fetch with different authentication mechanism.

Additionally, this limits flag fetching to webserver. What if clients want to fetch from database etc?

Lets allow clients to specify callback that we can execute.

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.