Skip to content

A simple library for feature flags in Go. (Experimental.)

License

Notifications You must be signed in to change notification settings

spreadshirt/go-feature

Repository files navigation

go-feature

Build Status GoDoc

Package feature provides a simple mechanism for creating and managing feature flags.

See ./examples/hello for an example.

Trying it out

  • run make && ./example-hello
  • visit http://localhost:22022/hello in your browser
  • run curl -XPOST 'http://localhost:22022/features/scream?enabled=true'
  • visit the /hello page again, and it will display a "louder" message (i.e. with more UPPERCASE letters)

Additional things to try out:

  • http://localhost:22022/features: Displays the list of features, and their state. If visited in a browser, it will provide a tiny user-interface for setting parameters.
  • curl -XPOST 'http://localhost:22022/features/surprise?enabled=true&ratio=0.75' (note the "ratio" parameter)

Building and testing

The Makefile is set up to work with a project-local GOPATH. Thus you can just run make to build the example, or make test to run the tests.

About

A simple library for feature flags in Go. (Experimental.)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published