Skip to content

Open the curtain and see if your feature is enabled

License

Notifications You must be signed in to change notification settings

rcleps/jcurtain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JCurtain

Easy way to control your features using redis.

Also available for ruby -> RCurtain!

Installation

Maven dependency:

Add this to your POM file

<dependency>
  <groupId>br.com.moip</groupId>
  <artifactId>jcurtain</artifactId>
  <version>0.1.0</version>
</dependency>

Usage

  • JCurtain uses redis to control features, which can be checked by a percentage or a set of users.
feature:[name-of-feature]:percentage
feature:[name-of-feature]:users
  • To use JCurtain, first your need to initialize the configuration by defining your redis URL (password@ip:port/database).
JCurtain jCurtain = new JCurtain(new URI(redis://:p4ssw0rd@10.0.1.1:6380/15)); 
  • Check if the curtain is opened for a feature using the method "isOpen", passing the name of the feature you want to check.
jCurtain.isOpen("name-of-the-feature");
  • You can also pass users to check if they'll see the new feature.
jCurtain.isOpen("name-of-the-feature", "user1");

If a user is on the Redis set in "feature:[name-of-the-feature]:users" the method will return true even when "feature:[name-of-the-feature]:percentage" is set to 0 or nil.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/moip/jcurtain. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

  1. Fork it ( https://github.com/moip/jcurtain/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

This lib is available as open source under the terms of the MIT License.

About

Open the curtain and see if your feature is enabled

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%