{"id":24390799,"url":"https://github.com/indrasaputra/toggle","last_synced_at":"2025-04-11T10:01:41.192Z","repository":{"id":45010799,"uuid":"370858345","full_name":"indrasaputra/toggle","owner":"indrasaputra","description":"Feature Flag or Feature Toggle application built with Go and gRPC","archived":false,"fork":false,"pushed_at":"2022-06-13T12:21:34.000Z","size":342,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-25T06:51:13.985Z","etag":null,"topics":["feature-flags","feature-toggles","go","golang","grpc","grpc-go","toggle"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/indrasaputra.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":"CODEOWNERS","security":null,"support":null}},"created_at":"2021-05-26T00:05:28.000Z","updated_at":"2023-03-15T03:03:48.000Z","dependencies_parsed_at":"2022-09-10T15:51:10.959Z","dependency_job_id":null,"html_url":"https://github.com/indrasaputra/toggle","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/indrasaputra%2Ftoggle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indrasaputra%2Ftoggle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indrasaputra%2Ftoggle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indrasaputra%2Ftoggle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indrasaputra","download_url":"https://codeload.github.com/indrasaputra/toggle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248372141,"owners_count":21093133,"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-flags","feature-toggles","go","golang","grpc","grpc-go","toggle"],"created_at":"2025-01-19T16:35:20.587Z","updated_at":"2025-04-11T10:01:41.165Z","avatar_url":"https://github.com/indrasaputra.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Toggle\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/indrasaputra/toggle)](https://goreportcard.com/report/github.com/indrasaputra/toggle)\n[![Workflow](https://github.com/indrasaputra/toggle/workflows/Test/badge.svg)](https://github.com/indrasaputra/toggle/actions)\n[![codecov](https://codecov.io/gh/indrasaputra/toggle/branch/main/graph/badge.svg?token=TF36qAeLI0)](https://codecov.io/gh/indrasaputra/toggle)\n[![Maintainability](https://api.codeclimate.com/v1/badges/019a5e0793400e5e90ba/maintainability)](https://codeclimate.com/github/indrasaputra/toggle/maintainability)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=indrasaputra_toggle\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=indrasaputra_toggle)\n[![Go Reference](https://pkg.go.dev/badge/github.com/indrasaputra/toggle.svg)](https://pkg.go.dev/github.com/indrasaputra/toggle)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)](https://github.com/pre-commit/pre-commit)\n\n\nToggle is a [Feature-Flag](https://martinfowler.com/articles/feature-toggles.html) application. It uses event-driven paradigm.\n\n## Owner\n\n[Indra Saputra](https://github.com/indrasaputra)\n\n## API\n\n### gRPC\n\nThe API can be seen in proto files (`*.proto`) in directory [proto](proto/indrasaputra/toggle/v1/toggle.proto).\n\n### RESTful JSON\n\nThe API can be seen via web using [Stoplight Elements](https://stoplight.io/open-source/elements/).\n\n```\n$ docker run -p 4000:80 indrasaputra/toggle-elements:latest\n```\n\nThen, visit `http://localhost:4000` in browser.\n\nIf docker is not preferred, the API is automatically generated in OpenAPIv2 format when generating gRPC codes.\nThe generated files are stored in directory [openapiv2](openapiv2) in JSON format (`*.json`).\nTo see the RESTful API contract, do the following:\n- Open the generated json file(s), such as [toggle.swagger.json](openapiv2/proto/indrasaputra/toggle/v1/toggle.swagger.json)\n- Copy the content\n- Open [https://editor.swagger.io/](https://editor.swagger.io/)\n- Paste the content in [https://editor.swagger.io/](https://editor.swagger.io/)\n\n## How to Run\n\n- Read [Prerequisites](doc/PREREQUISITES.md).\n- Then, read [How to Run](doc/HOW_TO_RUN.md).\n\n## Development Guide\n\n- Read [Prerequisites](doc/PREREQUISITES.md).\n- Then, read [Development Guide](doc/DEVELOPMENT_GUIDE.md).\n\n## Code Map\n\n- Read [Code Map](doc/CODE_MAP.md)\n\n## Testing\n\n### Unit Test\n\n```\n$ make test.unit\n```\n\n### Integration Test\n\n[godog](https://github.com/cucumber/godog/#install) is mandatory to perform integration test.\n\nTo run the integration test, make sure you already run the application successfully. Follow [How to Run](doc/HOW_TO_RUN.md) for the guideline.\nWhen application is running, then run command to execute integration test.\n\n```\n$ make test.integration\n```\n\nYou can also set the server URL, in case your default server is not localhost.\n\n```\n$ SERVER_URL=http://toggle:8081/v1/toggles make test.integration\n```\n\n### Load Test\n\nRunning smoke test, load test, and stress test is encouraged to know the sanity, performance, and stability of the service.\n[k6](https://k6.io/docs/) is used as load test executor.\n\n```sh\n$ k6 run \u003cpath to script file\u003e\n```\n\ne.g:\n\n```sh\n$ k6 run internal/script/loadtest/load_test.js\n```\n\nor use docker\n\n```sh\n$ make test.load\n```\n\n## Observability\n\nThe application already emits necessary telemetry. If application's dependencies are run using [docker compose](doc/HOW_TO_RUN.md#docker), then monitoring is [provided by default](docker-compose.yaml). Otherwise, you have to provide them.\nThese are stacks used as monitoring system.\n\n| Monitoring       | Stack                                              | Address                                           |\n| ---              | ---                                                | ---                                               |\n| Metrics          | [Prometheus](https://prometheus.io/)               | [http://localhost:9090](http://localhost:9090)    |\n| Visualization    | [Grafana](https://grafana.com/)                    | [http://localhost:3000](http://localhost:3000)    |\n| Tracing          | [Jaeger](https://www.jaegertracing.io/)            | [http://localhost:16686](http://localhost:16686)  |\n| Job Queue        | [Asynqmon](https://github.com/hibiken/asynqmon)    | [http://localhost:3001](http://localhost:3001)  |\n| Log              | [Zap](https://github.com/uber-go/zap)              | Stdout                                            |\n\nCurrently, tracing only works on gRPC server (handler), service/usecase, and redis. Postgres is not traced yet.\n\n## SDK\n\nThere is already an SDK to access Toggle. Currently, the SDK only supports Go. The SDK codes are located in this very repository. Visit [Toggle SDK](pkg/sdk/toggle/client.go).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findrasaputra%2Ftoggle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findrasaputra%2Ftoggle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findrasaputra%2Ftoggle/lists"}