All Projects → AntoineAugusti → Feature Flags

AntoineAugusti / Feature Flags

Licence: mit
Feature flags API written in Go

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Feature Flags

CloudKitFeatureFlags
A library that lets you setup feature flagging for your iOS app using CloudKit
Stars: ✭ 91 (-75.73%)
Mutual labels:  feature-flags, feature-toggles
toggler
toggler is a feature flag service to decouple deployment, feature enrollment and experiments
Stars: ✭ 27 (-92.8%)
Mutual labels:  feature-flags, feature-toggles
unleash-client-java
Unleash client SDK for Java
Stars: ✭ 86 (-77.07%)
Mutual labels:  feature-flags, feature-toggles
feature-flag-android
A Gradle plugin to achieve feature flag based development for Android applications.
Stars: ✭ 82 (-78.13%)
Mutual labels:  feature-flags, feature-toggles
jest-launchdarkly-mock
Easily unit test LaunchDarkly feature flagged components with jest
Stars: ✭ 14 (-96.27%)
Mutual labels:  feature-flags, feature-toggles
react-client-sdk
LaunchDarkly Client-side SDK for React.js
Stars: ✭ 42 (-88.8%)
Mutual labels:  feature-flags, feature-toggles
PowerShell-FeatureFlags
PowerShell module containing a Feature Flags implementation based on a local config file.
Stars: ✭ 15 (-96%)
Mutual labels:  feature-flags, feature-toggles
laravel-rollout
A package to integrate rollout into your Laravel project.
Stars: ✭ 23 (-93.87%)
Mutual labels:  feature-flags, feature-toggles
ruby-server-sdk
LaunchDarkly Server-side SDK for Ruby
Stars: ✭ 25 (-93.33%)
Mutual labels:  feature-flags, feature-toggles
Flags
⛳️ Feature Flags for Next.js
Stars: ✭ 277 (-26.13%)
Mutual labels:  feature-flags, feature-toggles
ios-client-sdk
LaunchDarkly Client-side SDK for iOS (Swift and Obj-C)
Stars: ✭ 45 (-88%)
Mutual labels:  feature-flags, feature-toggles
featurehub
FeatureHub - cloud native feature flags, A/B testing and remote configuration service. Real-time streaming feature updates. Provided with Java, JavaScript, Go, .Net, Android and Flutter SDKs.
Stars: ✭ 136 (-63.73%)
Mutual labels:  feature-flags, feature-toggles
Tweek
Tweek - an open source feature manager
Stars: ✭ 268 (-28.53%)
Mutual labels:  feature-flags, feature-toggles
flagsmith-js-client
Javascript Client for Flagsmith. Ship features with confidence using feature flags and remote config. Host yourself or use our hosted version at https://www.flagsmith.com/
Stars: ✭ 42 (-88.8%)
Mutual labels:  feature-flags, feature-toggles
nestjs-config
NestJS Module for Nonfig services. Nonfig combines Configurations and Features. So you change features, and release swiftly, and measure to digital impact.
Stars: ✭ 40 (-89.33%)
Mutual labels:  feature-flags, feature-toggles
Unleash
Unleash is the open source feature toggle service.
Stars: ✭ 4,679 (+1147.73%)
Mutual labels:  feature-flags, feature-toggles
eight ball
Ruby gem for querying feature flags
Stars: ✭ 17 (-95.47%)
Mutual labels:  feature-flags, feature-toggles
unleash-docker
Docker container for unleash
Stars: ✭ 89 (-76.27%)
Mutual labels:  feature-flags, feature-toggles
Flopflip
🎚Flip or flop features in your React application in real-time backed by flag provider of your choice 🚦
Stars: ✭ 334 (-10.93%)
Mutual labels:  feature-flags, feature-toggles
python-client
Python SDK client for Split Software
Stars: ✭ 12 (-96.8%)
Mutual labels:  feature-flags, feature-toggles

Travis CI Software License GoDoc Coverage Status

Feature flags API in Go

This package uses boltdb/bolt, a key-value store for storage. You do not need to connect another database! The HTTP routing is done by gorilla/mux.

What are feature flags?

Feature flags let you enable or disable some features of your application, for example when you're under unexpected traffic or when you want to let some users try a new feature you've been working on. They decouple feature release and code deployment, so that you can release features whenever you want, instead of whenever the code happens to ship.

With this package, you can enable the access of a feature for:

  • specific user IDs
  • specific groups
  • a percentage of your user base
  • everyone
  • no one

And you can combine things! You can give access to a feature for users in the group dev or admin and for users 1337 and 42 if you want to.

If you want to know everything about feature flags, check out this article.

Getting started

You can grab this package with the following command:

go get gopkg.in/antoineaugusti/feature-flags.v0

And then build it:

cd ${GOPATH%/}/src/github.com/antoineaugusti/feature-flags
go build

Usage

From the -h flag:

Usage of ./feature-flags:
  -a string
        address to listen (default ":8080")
  -d string
        location of the database file (default "bolt.db")

Authentication

This API does not ship with an authentication layer. You should not expose the API to the Internet. This API should be deployed behind a firewall, only your application servers should be allowed to send requests to the API.

API Endpoints

API Documentation

GET /features

Get a list of available feature flags.

  • Method: GET
  • Endpoint: /features
  • Responses:
    • 200 OK
    [
       {
          "key":"homepage_v2",
          "enabled":false,
          "users":[],
          "groups":[
             "dev",
             "admin"
          ],
          "percentage":0
       },
       {
          "key":"portfolio",
          "enabled":false,
          "users":[
             1337,
             42
          ],
          "groups":[
             "dev",
             "admin"
          ],
          "percentage":50
       }
    ]
    
    • key is the name of the feature flag
    • enabled: tell if the feature flag is enabled. If true, everybody has access to the feature flag. Otherwise, the access rule depends on the value of the other attributes.
    • users: an array of user IDs who can have access to the feature even if it's disabled.
    • groups: an array of group names which can have access to the feature even if it's disabled.
    • percentage: a number between 0 and 100. If the percentage is 50, 50% of the user base is going to have access to the feature.

POST /features

Create a new feature flag.

  • Method: POST

  • Endpoint: /features

  • Input: The Content-Type HTTP header should be set to application/json

    {
      "key":"homepage_v2",
      "enabled":false,
      "users":[],
      "groups":[
         "dev",
         "admin"
      ],
      "percentage":0
    }
    
  • Responses:

    • 201 Created
    {
      "key":"homepage_v2",
      "enabled":false,
      "users":[],
      "groups":[
         "dev",
         "admin"
      ],
      "percentage":0
    }
    
    • 422 Unprocessable entity:
    {
      "status":"invalid_json",
      "message":"Cannot decode the given JSON payload"
    }
    
    • 400 Bad Request
    {
      "status":"invalid_feature",
      "message":"<reason>"
    }
    

    Common reasons:

    • the feature key already exists. The message will be Feature already exists
    • the percentage must be between 0 and 100
    • the feature key must be between 3 and 50 characters
    • the feature key must only contain digits, lowercase letters and underscores

GET /features/:featureKey

Get a specific feature flag.

  • Method: GET
  • Endpoint: /features/:featureKey
  • Responses:
    • 200 OK
    {
      "key":"homepage_v2",
      "enabled":false,
      "users":[],
      "groups":[
         "dev",
         "admin"
      ],
      "percentage":0
    }
    
    • 404 Not Found
    {
      "status":"feature_not_found",
      "message":"The feature was not found"
    }
    

DELETE /features/:featureKey

Remove a feature flag.

  • Method: DELETE
  • Endpoint: /features/:featureKey
  • Responses:
    • 200 OK
    {
      "status":"feature_deleted",
      "message":"The feature was successfully deleted"
    }
    
    • 404 Not Found
    {
      "status":"feature_not_found",
      "message":"The feature was not found"
    }
    

PATCH /features/:featureKey

Update a feature flag.

  • Method: PATCH

  • Endpoint: /features/:featureKey

  • Input: The Content-Type HTTP header should be set to application/json

    {
      "enabled":true,
      "users":[
        13,
        37
      ],
      "groups":[
         "dev"
      ],
      "percentage":42
    }
    
  • Responses:

    • 200 OK
    {
      "key":"homepage_v2",
      "users":[
        13,
        37
      ],
      "groups":[
         "dev"
      ],
      "percentage":42
    }
    
    • 404 Not Found
    {
      "status":"feature_not_found",
      "message":"The feature was not found"
    }
    
    • 422 Unprocessable entity:
    {
      "status":"invalid_json",
      "message":"Cannot decode the given JSON payload"
    }
    
    • 400 Bad Request
    {
      "status":"invalid_feature",
      "message":"<reason>"
    }
    

    Common reason:

    • the percentage must be between 0 and 100

POST /features/access

Get a list of accessible features for a user or a list of groups.

  • Method: POST

  • Endpoint: /features/access

  • Input: The Content-Type HTTP header should be set to application/json

    {
      "groups":[
         "dev",
         "test"
      ],
      "user":42
    }
    
  • Responses:

    • 200 OK

    Same as in POST /features. An empty array indicates that no known features are accessible for the given input.

    • 422 Unprocessable entity:
    {
      "status":"invalid_json",
      "message":"Cannot decode the given JSON payload"
    }
    

POST /features/:featureKey/access

Check if a feature flag is enabled for a user or a list of groups.

  • Method: POST

  • Endpoint: /features/:featureKey/access

  • Input: The Content-Type HTTP header should be set to application/json

    {
      "groups":[
         "dev",
         "test"
      ],
      "user":42
    }
    
  • Responses:

    • 200 OK
    {
      "status":"has_access",
      "message":"The user has access to the feature"
    }
    
    {
      "status":"not_access",
      "message":"The user does not have access to the feature"
    }
    
    • 404 Not Found
    {
      "status":"feature_not_found",
      "message":"The feature was not found"
    }
    
    • 422 Unprocessable entity:
    {
      "status":"invalid_json",
      "message":"Cannot decode the given JSON payload"
    }
    
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].