Code Monkey home page Code Monkey logo

laika's Introduction

Laika

CircleCI Coverage Status

Laika is a feature flag/feature toggle service, written in Go, that allows the creation of flags and their activation/deactivation for specific environments. This way it is possible to control in which environments each feature is available. For instance, when a new feature is developed and released, it would make sense if it was only made available, at first, in a testing or Q&A environment, and only later in production. With Laika this can be achieved by simply going to a web page, selecting the feature, and changing its status on the desired environments.

Using Laika in a project thus allows for fast and continuous feature release and deployment.

laika-php is a PHP library that handles communication with Laika's API. You can get it here.

API Reference

Method Endpoint Description
GET /api/health Check the service health
GET /api/features List all features
GET /api/features/:name Get a feature by name
POST /api/features Create a feature
PATCH /api/features/:name Update a feature
GET /api/environments List all environments
GET /api/environments/:name Get an environment by name
POST /api/environments Create an environment
PATCH /api/environments/:name Update an environment
GET /api/users/:username Get a user by username
POST /api/users Create a user

Client

Laika contains a polling HTTP client that allows to easily check for enabled/disabled features on Go code. It can be found in the client package. While Laika uses the vendor directory to store external dependencies, client can be imported without any vendoring.

Install

$ go get -u github.com/MEDIGO/laika/client

Usage

package main

import (
	"log"

	"github.com/MEDIGO/laika/client"
)

func main() {
	c, err := client.NewClient(client.Config{
		Addr:        "127.0.0.1:8000",
		Username:    "my-username",
		Password:    "my-password",
		Environment: "prod",
	})

	if err != nil {
		log.Fatal(err)
	}

	if c.IsEnabled("my-awesome-feature", false) {
		log.Print("IT'S ALIVE!")
	} else {
		log.Print("Move along. Nothing to see here.")
	}
}

Developing

To develop Laika you need to have the following tools installed in your machine:

Then install all the Go and Javascript dependencies with:

$ make install

Migrate the database with:

$ make migrate

Build continuously the server and UI with:

$ make watch

And start hacking!

$ open http://localhost:8000

Testing

The whole test suite can be executed with:

$ make test

Some test require a MySQL instance, you can pass the configuration to them with the following environment variables:

LAIKA_TEST_MYSQL_HOST=localhost
LAIKA_TEST_MYSQL_PORT=3306
LAIKA_TEST_MYSQL_USERNAME=root
LAIKA_TEST_MYSQL_PASSWORD=root
LAIKA_TEST_MYSQL_DBNAME=test

Current state of the project

In the current release of Laika, it is possible to create feature flags and enable/disable them in the existing environments.

Wishlist

  • Specify country access (e.g. feature only enabled in Germany).
  • Specify user access with percentage (e.g. feature only enabled for 30% of the user base).
  • Have a field for environment creation on the web page.
  • History for flag status changes.

Copyright and license

Copyright © 2016 MEDIGO GmbH.

Laika is licensed under the MIT License. See LICENSE for the full license text.

laika's People

Contributors

alexyans avatar d-buettner avatar dbrabera avatar eggman64 avatar mbernardes avatar soonick avatar ssimono avatar

Watchers

 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.