{"id":23223344,"url":"https://github.com/imantung/feato","last_synced_at":"2025-04-05T16:31:33.470Z","repository":{"id":57598921,"uuid":"185152941","full_name":"imantung/feato","owner":"imantung","description":null,"archived":false,"fork":false,"pushed_at":"2020-08-29T09:32:45.000Z","size":31,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-11T13:31:37.103Z","etag":null,"topics":["feature-flag","feature-toggle"],"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/imantung.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-06T08:14:41.000Z","updated_at":"2024-06-28T10:45:03.000Z","dependencies_parsed_at":"2022-09-26T19:53:30.264Z","dependency_job_id":null,"html_url":"https://github.com/imantung/feato","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/imantung%2Ffeato","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imantung%2Ffeato/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imantung%2Ffeato/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imantung%2Ffeato/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imantung","download_url":"https://codeload.github.com/imantung/feato/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247365553,"owners_count":20927349,"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":["feature-flag","feature-toggle"],"created_at":"2024-12-18T23:17:08.172Z","updated_at":"2025-04-05T16:31:33.424Z","avatar_url":"https://github.com/imantung.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/imantung/feato)](https://goreportcard.com/report/github.com/imantung/feato)\n[![Coverage](https://gocover.io/_badge/github.com/imantung/feato)](https://gocover.io/github.com/imantung/feato)\n\n\n# feato\n\n[Simplest possible **fea**ture **to**ggle](https://www.thoughtworks.com/radar/techniques?blipid=202005002) Library in Go\n\n## Usage\n\nConvenience function using global instance\n```go\nfeato.RegisterGlobal([]*feato.Feature{\n\t{Name: \"group01\", Childs: []*feato.Feature{\n\t\t{Name: \"name03\", Flag: feato.Enabled},\n\t\t{Name: \"name04\", Flag: feato.Disabled},\n\t}},\n})\n\nif feato.IsEnabled(\"group01.name03\") {\n\tfmt.Println(\"group01.name03 is enabled\")\n}\n\n// Output: group01.name03 is enabled\n```\n\nParseable to JSON or other format\n```go\nflagMap := make(feato.FlagMap, 0)\nfeato.Register(flagMap, []*feato.Feature{\n\t{Name: \"name01\", Flag: feato.Enabled},\n\t{Name: \"name02\", Flag: feato.Disabled},\n\t{Name: \"group01\", Childs: []*feato.Feature{\n\t\t{Name: \"name03\", Flag: feato.Enabled},\n\t\t{Name: \"name04\", Flag: feato.Disabled},\n\t\t{Name: \"sub01\", Flag: feato.Enabled, Childs: []*feato.Feature{\n\t\t\t{Name: \"name05\", Flag: feato.Enabled},\n\t\t\t{Name: \"name06\", Flag: feato.Disabled},\n\t\t}},\n\t}},\n})\n\nb, _ := json.MarshalIndent(flagMap, \"\", \"   \")\nfmt.Println(string(b))\n\n// Output: {\n//    \"group01.name03\": true,\n//    \"group01.name04\": false,\n//    \"group01.sub01\": true,\n//    \"group01.sub01.name05\": true,\n//    \"group01.sub01.name06\": false,\n//    \"name01\": true,\n//    \"name02\": false\n// }\n```\n\n\n## References\n\n- \u003chttps://medium.com/@dehora/feature-flags-smaller-better-faster-software-development-f2eab58df0f9\u003e\n- \u003chttps://martinfowler.com/articles/feature-toggles.html\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimantung%2Ffeato","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimantung%2Ffeato","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimantung%2Ffeato/lists"}