{"id":20866348,"url":"https://github.com/edwin-luijten/go_command_bus","last_synced_at":"2026-05-21T12:09:09.151Z","repository":{"id":57609935,"uuid":"174124346","full_name":"Edwin-Luijten/go_command_bus","owner":"Edwin-Luijten","description":"A simple command bus for go","archived":false,"fork":false,"pushed_at":"2021-10-26T15:48:43.000Z","size":19,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-18T18:47:20.613Z","etag":null,"topics":["commandbus","go","hacktoberfest"],"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/Edwin-Luijten.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-03-06T10:33:15.000Z","updated_at":"2021-10-26T14:58:55.000Z","dependencies_parsed_at":"2022-08-27T21:50:39.645Z","dependency_job_id":null,"html_url":"https://github.com/Edwin-Luijten/go_command_bus","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edwin-Luijten%2Fgo_command_bus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edwin-Luijten%2Fgo_command_bus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edwin-Luijten%2Fgo_command_bus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Edwin-Luijten%2Fgo_command_bus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Edwin-Luijten","download_url":"https://codeload.github.com/Edwin-Luijten/go_command_bus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243240282,"owners_count":20259397,"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":["commandbus","go","hacktoberfest"],"created_at":"2024-11-18T05:57:57.160Z","updated_at":"2025-12-25T12:22:12.570Z","avatar_url":"https://github.com/Edwin-Luijten.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Command Bus for GO\n\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/edwin-luijten/go_command_bus?style=flat-square) \n[![Go Reference](https://pkg.go.dev/badge/github.com/Edwin-Luijten/go_command_bus.svg)](https://pkg.go.dev/github.com/Edwin-Luijten/go_command_bus)\n[![Build Status](https://travis-ci.com/Edwin-Luijten/go_command_bus.svg?branch=master)](https://travis-ci.com/Edwin-Luijten/go_command_bus) \n[![Maintainability](https://api.codeclimate.com/v1/badges/ff5d37cbc59ef9a174a5/maintainability)](https://codeclimate.com/github/Edwin-Luijten/go_command_bus/maintainability) \n[![Test Coverage](https://api.codeclimate.com/v1/badges/ff5d37cbc59ef9a174a5/test_coverage)](https://codeclimate.com/github/Edwin-Luijten/go_command_bus/test_coverage)\n## Installation\n``` go get github.com/edwin-luijten/go_command_bus ```\n\n## Usage\n\n### Commands\n```go\nimport (\n    commandbus \"github.com/edwin-luijten/go_command_bus\"\n)\n\nfunc main() {\n    bus := commandbus.New()\n    \n    bus.RegisterHandler(\u0026RegisterUserCommand{}, func(command interface{}) {\n        cmd := command.(*RegisterUserCommand)\n        \n        fmt.Sprintf(\"Registered %s\", cmd.Username)\n    })\n    \n    bus.Handle(\u0026RegisterUserCommand{\n    \tEmail: \"jj@email.com\",\n    \tPassword: \"secret\",\n    })\n}\n```\n\n### Middleware's\n\nA middleware has a handler and a priority.  \nWhere priority of 0 is the least amount of priority.  \n```go\nimport (\n    commandbus \"github.com/edwin-luijten/go_command_bus\"\n)\n\nfunc main() {\n    bus := commandbus.New()\n    \n    bus.RegisterMiddleware(func(command interface{}, next HandlerFunc) {\n        \n    \t// your logic here\n    \n        next(command)\n    \n        // or here\n    }, 1) \n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedwin-luijten%2Fgo_command_bus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedwin-luijten%2Fgo_command_bus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedwin-luijten%2Fgo_command_bus/lists"}