You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fast and concurrent-safe feature flags for golang based on Redis. Inspired by the ruby rollout gem.
Installation
go get github.com/salesloft/gorollout
Usage
package main
import (
"github.com/go-redis/redis/v7"
rollout "github.com/salesloft/gorollout"
)
var (
apples=rollout.NewFeature("apples")
bananas=rollout.NewFeature("bananas")
)
funcmain() {
// instantiate a feature manager with a redis client and namespace prefixmanager:=rollout.NewManager(redis.NewClient(&redis.Options{}), "rollout")
// activate a featuremanager.Activate(apples)
// deactivate a featuremanager.Deactivate(apples)
// rollout a feature to 25% of teamsmanager.ActivatePercentage(apples, 25)
// explicitly activate a feature for team with id 99manager.ActivateTeam(99, apples)
// check if a feature is active, globallymanager.IsActive(apples)
// check if a feature is active for a specific team (randomize percentage disabled)manager.IsTeamActive(99, apples, false)
// check multiple feature flags at oncemanager.IsActiveMulti(apples, bananas)
}
Command Line Interface (CLI)
gorollout also includes a command line interface for viewing and managing feature flags.