Skip to content

tjhoff/exflag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExFlag

Goals:

  • Retrieve a value from a server for a known key with optional host parameters
  • This may include host name, environment, version, etc...
  • Value is an atom (on / off, a / b / c, etc)

Non-Goals (right now)

  • Provide offline storage / caching of keys

python server

#!/usr/bin/python3

from flask import Flask, request


app = Flask(__name__)
@app.route("/flags", methods=['POST'])
def get_flag():
    r_body = request.get_json()
    print(r_body)
    flag_key = r_body["key"]
    options = r_body["opts"]
    env = options.get("environment")

    if env == "production":
        return "{\"value\": \"on\"}", 200
    else:
        return "{\"value\": \"off\"}", 200

Usage

Installation

If available in Hex, the package can be installed by adding exflag to your list of dependencies in mix.exs:

def deps do
  [
    {:exflag, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/exflag.

About

Feature flag library for elixir.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages