{"id":42049214,"url":"https://github.com/donutloop/toolkit","last_synced_at":"2026-01-26T06:33:03.387Z","repository":{"id":48153611,"uuid":"104051120","full_name":"donutloop/toolkit","owner":"donutloop","description":"Collection of useful patterns","archived":false,"fork":false,"pushed_at":"2021-05-10T20:46:03.000Z","size":162,"stargazers_count":159,"open_issues_count":2,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-14T10:41:05.652Z","etag":null,"topics":["api","code-generation","code-generator","concurrent","event-sourcing","fifo-queue","lease","message-bus","promise","retry","singleton","worker"],"latest_commit_sha":null,"homepage":null,"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/donutloop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-19T08:54:53.000Z","updated_at":"2025-04-11T10:06:10.000Z","dependencies_parsed_at":"2022-08-31T11:03:15.927Z","dependency_job_id":null,"html_url":"https://github.com/donutloop/toolkit","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/donutloop/toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donutloop%2Ftoolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donutloop%2Ftoolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donutloop%2Ftoolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donutloop%2Ftoolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/donutloop","download_url":"https://codeload.github.com/donutloop/toolkit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donutloop%2Ftoolkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28768382,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T03:54:34.369Z","status":"ssl_error","status_checked_at":"2026-01-26T03:54:33.031Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api","code-generation","code-generator","concurrent","event-sourcing","fifo-queue","lease","message-bus","promise","retry","singleton","worker"],"created_at":"2026-01-26T06:33:03.317Z","updated_at":"2026-01-26T06:33:03.375Z","avatar_url":"https://github.com/donutloop.png","language":"Go","readme":"# toolkit\n\n[![Build Status](https://travis-ci.org/donutloop/toolkit.svg?branch=master)](https://travis-ci.org/donutloop/toolkit)\n[![Coverage Status](https://coveralls.io/repos/github/donutloop/toolkit/badge.svg)](https://coveralls.io/github/donutloop/toolkit)\n[![Go Report Card](https://goreportcard.com/badge/github.com/donutloop/toolkit)](https://goreportcard.com/report/github.com/donutloop/toolkit)\n\n## Introduction\n\nThese patterns can you use to solve common problems when designing an application or system.\n\n## Requirements\n\n* [golang](https://golang.org/) \u003e=1.11.x - The Go Programming Language\n\n## Installation\n\n```sh\ngo get github.com/donutloop/toolkit/{any_package}\n```\n\n### Example\n\n```sh\ngo get github.com/donutloop/toolkit/worker\n```\n\n## Patterns \n\n* [Worker](https://github.com/donutloop/toolkit/blob/master/worker/README.md)\n* [Job schedule](https://github.com/donutloop/toolkit/blob/master/schedule/README.md)\n* [Singleton](https://github.com/donutloop/toolkit/blob/master/singleton/README.md)\n* [Retry](https://github.com/donutloop/toolkit/blob/master/retry/README.md) \n* [Promise](https://github.com/donutloop/toolkit/blob/master/promise/README.md) \n* [Multierror](https://github.com/donutloop/toolkit/blob/master/multierror/README.md)\n* [Loop](https://github.com/donutloop/toolkit/blob/master/loop/README.md) \n* [Lease](https://github.com/donutloop/toolkit/blob/master/lease/README.md)\n* [Event-system](https://github.com/donutloop/toolkit/blob/master/event/README.md)\n* [Debugutil](https://github.com/donutloop/toolkit/blob/master/debugutil/README.md)\n* [Concurrent runner](https://github.com/donutloop/toolkit/blob/master/concurrent/README.md)\n* [Bus-system](https://github.com/donutloop/toolkit/blob/master/bus/README.md)\n\n## Examples \n\nIn each sub directory is a set of examples \n\n## Code generation\n\n`Currently, it's only compatiable with version 2.x.x`\n\nThe code generation tool generates for a pattern an none generic version for spefici type\n\n### Supported pattern\n\n* [Worker](https://github.com/donutloop/toolkit/blob/master/worker/README.md)\n\n### Build\n\n```bash\nmkdir -p $GOPATH/src/github.com/donutloop/ \u0026\u0026 cd $GOPATH/src/github.com/donutloop/\n\ngit clone git@github.com:donutloop/toolkit.git\n\ncd toolkit\n\ngo install ./cmd/xcode\n```\n\n### Usage\n\n```bash\nUSAGE\n  xcode [flags]\n\nFLAGS\n  -in     input file\n  -out    output file\n  -pkg    package name\n  -type   type\n```\n\n#### Example generation \n\n```bash \nxcode -in $GOPATH/src/github.com/donutloop/toolkit/worker/worker.go -out $GOPATH/src/github.com/donutloop/toolkit/worker/new_worker.go -pkg test -type int32 \n```\n\n#### Example call for generated code \n\n```bash\nworkerHandler := func(v int32) {\n    fmt.Println(v)\n}\n\nqueue := worker.New(2, workerHandler, 10)\n\nqueue \u003c- int32(3)\n```\n\n## Contribution\n\nThank you for considering to help out with the source code! We welcome contributions from\nanyone on the internet, and are grateful for even the smallest of fixes!\n\nIf you'd like to contribute to toolkit, please fork, fix, commit and send a pull request\nfor the maintainers to review and merge into the main code base to ensure those changes are in line with the general philosophy of the project and/or get some\nearly feedback which can make both your efforts much lighter as well as our review and merge\nprocedures quick and simple.\n\nPlease read and follow our [Contributing](https://github.com/donutloop/toolkit/blob/master/CONTRIBUTING.md).\n\n## Code of Conduct\n\nPlease read and follow our [Code of Conduct](https://github.com/donutloop/toolkit/blob/master/CODE_OF_CONDUCT.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonutloop%2Ftoolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdonutloop%2Ftoolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonutloop%2Ftoolkit/lists"}