{"id":19216570,"url":"https://github.com/fbeline/rollout","last_synced_at":"2025-10-19T09:39:13.119Z","repository":{"id":57513582,"uuid":"126425277","full_name":"fbeline/rollout","owner":"fbeline","description":"Feature based rollout for Go","archived":false,"fork":false,"pushed_at":"2018-03-30T03:47:46.000Z","size":16,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-12T23:42:13.083Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fbeline.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-23T03:01:01.000Z","updated_at":"2024-08-06T17:26:11.000Z","dependencies_parsed_at":"2022-08-30T07:20:09.621Z","dependency_job_id":null,"html_url":"https://github.com/fbeline/rollout","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbeline%2Frollout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbeline%2Frollout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbeline%2Frollout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbeline%2Frollout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fbeline","download_url":"https://codeload.github.com/fbeline/rollout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253843168,"owners_count":21972867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T14:17:41.248Z","updated_at":"2025-10-19T09:39:13.036Z","avatar_url":"https://github.com/fbeline.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rollout [![Build Status](https://scrutinizer-ci.com/g/fbeline/rollout/badges/build.png?b=master)](https://scrutinizer-ci.com/g/fbeline/rollout/build-status/master) [![Code Coverage](https://scrutinizer-ci.com/g/fbeline/rollout/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/fbeline/rollout/?branch=master) [![](https://godoc.org/github.com/nathany/looper?status.svg)](https://godoc.org/github.com/fbeline/rollout)\n\nFeature based rollout for Golang.\n\n## Installation\n\n`go get github.com/fbeline/rollout`\n\n## Introduction\n\nrollout is a library used to create feature rollouts based on percentage.\n\nusage examples:\n\n- You have a new feature and you want to expose that only for 5% of your userbase.\n\n- A/B tests.\n\nThe library is free of any persistence system, but I strongly recommend to you to persist the rollout state at disk instead make it hardcoded. In that way, you will be able to fast manipulate the rollout percentages and status.\n\n## How to use\n\nimport the rollout package\n\n```go\nimport \"github.com/fbeline/rollout\"\n```\n\n### Creating a rollout\n\n```go\nvar foo = rollout.Feature{Name: \"foo\", Percentage: 0.5, Active: true, Whitelist: []string{}}\nvar bar = rollout.Feature{Name: \"bar\", Percentage: 0.7, Active: true, Whitelist: []string{}}\nvar features = []rollout.Feature{foo, bar}\nvar r = rollout.Create(features)\n```\n\n### Check if a feature is active for a given user\n\n```go\n\u003crollout instance\u003e.IsActive(\"featureName\", \"UserId\")\n```\n\n### Upsert a feature\n\nThe feature name is used as a unique key. If the feature exists it will be updated otherwise created.\n\n```go\nvar newFoo = rollout.Feature{Name: \"foo\", Percentage: 0.8, Active: true}\n\u003crollout instance\u003e.Set(newFoo)\n```\n\n### Checking if a feature is active\n\n```go\n\u003crollout instance\u003e.IsFeatureActive(\"featureName\")\n```\n\n### Activate a feature\n\n```go\n\u003crollout instance\u003e.Activate(\"featureName\")\n```\n\n### Deactivate a feature\n\n```go\n\u003crollout instance\u003e.Deactivate(\"featureName\")\n```\n\n### Get a feature\n\nThe first value (f) is assigned the value stored under the feature name.The second value (ok) is a bool that is true if the feature exists, and false if not.\n\n```go\nf, ok := \u003crollout instance\u003e.Get(\"featureName\")\n```\n\n### Get all features\n\n```go\n\u003crollout instance\u003e.GetAll()\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbeline%2Frollout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffbeline%2Frollout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbeline%2Frollout/lists"}