{"id":20503399,"url":"https://github.com/boylegu/regal-go","last_synced_at":"2026-07-18T17:33:38.577Z","repository":{"id":236515470,"uuid":"791883127","full_name":"boylegu/regal-go","owner":"boylegu","description":"A/B Testing or gray released smart grouping engine","archived":false,"fork":false,"pushed_at":"2024-05-25T08:59:57.000Z","size":655,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T12:06:07.137Z","etag":null,"topics":["ab-test","golang","gray-release"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boylegu.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-25T14:56:02.000Z","updated_at":"2025-09-19T03:55:18.000Z","dependencies_parsed_at":"2024-05-20T17:36:27.459Z","dependency_job_id":"bd4dc0ec-afe8-4d6e-a15e-97385e779abf","html_url":"https://github.com/boylegu/regal-go","commit_stats":null,"previous_names":["boylegu/regal-go"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/boylegu/regal-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boylegu%2Fregal-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boylegu%2Fregal-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boylegu%2Fregal-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boylegu%2Fregal-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boylegu","download_url":"https://codeload.github.com/boylegu/regal-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boylegu%2Fregal-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35626138,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-18T02:00:07.223Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ab-test","golang","gray-release"],"created_at":"2024-11-15T19:31:03.108Z","updated_at":"2026-07-18T17:33:38.560Z","avatar_url":"https://github.com/boylegu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\r\n\r\n\u003ch1 style=\"border-bottom: none\"\u003e\r\n    \u003cb style=\"color: #E940AF\"\u003eRegal\u003c/b\u003e\u003cb style=\"color: #66C9D6\"\u003e-Go\u003c/b\u003e\u003cbr /\u003e\r\n\u003c/h1\u003e\r\n\u003cp\u003e\r\nThe smart grouping engine for A/B Testing or Gray release by Golang.\r\n\u003c/p\u003e\r\n\r\n[![go](https://img.shields.io/badge/Go-1.18+-66C9D6)]()\r\n[![ver](https://img.shields.io/badge/version-1.0.0-66C9D6)]()\r\n[![Maintainability](https://api.codeclimate.com/v1/badges/4c478e05a95251b6a818/maintainability)](https://codeclimate.com/github/boylegu/regal-go/maintainability)\r\n[![go](https://img.shields.io/badge/license-MIT-E940AF)]()\r\n\r\n\u003cp align=\"center\"\u003e\r\n\u003cimg src=\"https://github.com/boylegu/regal-go/blob/main/image/regal-white.png?raw=true\" width=\"330\" height=\"300\"\u003e\r\n\u003c/p\u003e\r\n\u003c/div\u003e\r\n\r\nEnglish | [简体中文](https://github.com/boylegu/regal-go/blob/main/README.zh-CN.md) | [Regal by Python](https://github.com/boylegu/regal)\r\n\r\n## what's Regal-Go\r\n\r\nFor example, let's say you need to do a staged rollout for a particular version  or several, which could be a bunch of server clusters, as shown in the following diagram:\r\n\r\n\u003cp align=\"center\"\u003e\r\n\u003cimg src=\"https://github.com/boylegu/regal-go/blob/main/image/fig01.png?raw=true\"\u003e\r\n\u003c/p\u003e\r\n\r\n\r\nThe regal-go provides two policies:\r\n\r\n- Combine\r\n\r\nNumber of machines in each group.\r\n\r\n- Schedule\r\n\r\nAs the first group of A/B, the default is 1.\r\nYou can change this behavior by using the 'schedule' parameter.\r\n\r\n\u003e\u003e See the example for more details.\r\n\r\n## Feature\r\n\r\n1. Provide A/B Test or Gray release policies and dynamic intelligent distribution;\r\n2. Support multi-version grouping and priority;\r\n3. Lightweight and scalable;\r\n\r\n## Examples\r\n\r\nSee  [./example](./example) for example usage.\r\n\r\n### Example-1\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"github.com/boylegu/regal-go\"\r\n)\r\n\r\nfunc main() {\r\n\tvar example1 = [][]string{\r\n\t\t{\"app-test-ver1\", \"10.1.1.1,10.1.1.2,10.1.1.3,10.1.1.4,10.1.1.5\"},\r\n\t}\r\n\tc1 := regal.RegalEngine(example1, regal.WithCombine(2))\r\n\tfmt.Println(c1.Grouping())\r\n}\r\n```\r\nOutput:\r\n\r\n```shell\r\n[root@gbe-pcx example]# go run main.go\r\n[[app-test-version1.0 [[10.1.1.1] [10.1.1.2 10.1.1.3] [10.1.1.4 10.1.1.5]]]]\r\n```\r\nBased on policy, you will get a data structure. Let's take a look at it:\r\n\r\n\u003cp align=\"center\"\u003e\r\n\u003cimg src=\"https://github.com/boylegu/regal-go/blob/main/image/fig02.png?raw=true\"\u003e\r\n\u003c/p\u003e\r\n\r\n### Example-2\r\n\r\n```go\r\n\tvar example2 = [][]string{\r\n\t\t{\"ver1\", \"10.1.1.1,10.1.1.2,10.1.1.3,10.1.1.4,10.1.1.5,10.1.1.6\"},\r\n\t\t{\"ver2\", \"10.1.1.1,10.1.1.2,10.1.1.3,10.1.1.4,10.1.1.5\"},\r\n\t\t{\"ver3\", \"10.1.1.1,10.1.1.2,10.1.1.3,10.1.1.4,10.1.1.5\"},\r\n\t}\r\n\tc2 := regal.RegalEngine(\r\n\t\texample2,\r\n\t\tregal.WithCombine(3),\r\n\t\tregal.WithSchedule(2),\r\n\t\tregal.WithPriorKey(\"ver2\"), // Set priority\r\n\t)\r\n\tfor _, v := range c2.Grouping() {\r\n\t\tfmt.Println(v)\r\n\t}\r\n\r\n```\r\n\r\nOutput:\r\n\r\n```shell\r\n[root@gubaoer-pcx example]# go run main.go\r\n[ver2 [[10.1.1.1, 10.1.1.2] [10.1.1.3 10.1.1.4 10.1.1.5]]]\r\n[ver1 [[10.1.1.1, 10.1.1.2] [10.1.1.3 10.1.1.4 10.1.1.5] [10.1.1.6]]]\r\n[ver3 [[10.1.1.1, 10.1.1.2] [10.1.1.3 10.1.1.4 10.1.1.5]]]\r\n```\r\n\r\n### Darwin's finches\r\n\r\n\u003cp align=\"let\"\u003e\r\n\u003cimg src=\"https://github.com/boylegu/regal-go/blob/main/image/b.jpg?raw=true\" width=\"200\" height=\"200\"\u003e\r\n\u003c/p\u003e\r\n\r\nHuman creation has never left the inspiration brought to us by nature, and whether it is gray release or A/B testing, nature had excellent solutions thousands of years ago.\r\nTherefore, I use 'Darwin's finches' as the prototype to pay tribute to the great nature and Darwin's 《ORIGIN OF SPECIES》.\r\n\r\n\u003e Author: Boyle Gu. Drawing with DeepAI in 2024.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboylegu%2Fregal-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboylegu%2Fregal-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboylegu%2Fregal-go/lists"}