{"id":13413495,"url":"https://github.com/lana/go-commandbus","last_synced_at":"2025-03-14T19:32:23.649Z","repository":{"id":44757198,"uuid":"212670137","full_name":"lana/go-commandbus","owner":"lana","description":"Simple command bus for GO","archived":false,"fork":false,"pushed_at":"2022-01-26T15:20:42.000Z","size":22,"stargazers_count":12,"open_issues_count":0,"forks_count":5,"subscribers_count":23,"default_branch":"master","last_synced_at":"2024-07-31T20:52:23.310Z","etag":null,"topics":[],"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/lana.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}},"created_at":"2019-10-03T20:08:22.000Z","updated_at":"2024-05-22T18:51:44.000Z","dependencies_parsed_at":"2022-09-02T06:44:20.295Z","dependency_job_id":null,"html_url":"https://github.com/lana/go-commandbus","commit_stats":null,"previous_names":["vsmoraes/go-commandbus"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lana%2Fgo-commandbus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lana%2Fgo-commandbus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lana%2Fgo-commandbus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lana%2Fgo-commandbus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lana","download_url":"https://codeload.github.com/lana/go-commandbus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243635466,"owners_count":20322945,"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":[],"created_at":"2024-07-30T20:01:41.664Z","updated_at":"2025-03-14T19:32:23.337Z","avatar_url":"https://github.com/lana.png","language":"Go","readme":"# GO CommandBus\n\n[![Build Status](https://img.shields.io/travis/lana/go-commandbus/master.svg?style=flat-square)](https://travis-ci.org/lana/go-commandbus)\n[![Codecov branch](https://img.shields.io/codecov/c/github/lana/go-commandbus/master.svg?style=flat-square)](https://codecov.io/gh/lana/go-commandbus)\n[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](https://godoc.org/github.com/lana/go-commandbus)\n[![Go Report Card](https://goreportcard.com/badge/github.com/lana/go-commandbus?style=flat-square)](https://goreportcard.com/report/github.com/lana/go-commandbus)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://github.com/lana/go-commandbus/blob/master/LICENSE)\n\nA slight and pluggable command-bus for Go.\n\n## Install\n\nUse go get.\n```sh\n$ go get github.com/lana/go-commandbus\n```\n\nThen import the package into your own code:\n```\nimport \"github.com/lana/go-commandbus\"\n```\n\n## Usage\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/lana/go-commandbus\"\n)\n\ntype CreateUser struct {\n\tName string\n}\n\nfunc CreateHandler(ctx context.Context, cmd *CreateUser) error {\n\tlog.Printf(\"user %s created\", cmd.Name)\n\n\treturn nil\n}\n\nfunc main() {\n\tbus := commandbus.New()\n\n\terr := bus.Register(\u0026CreateUser{}, CreateHandler)\n\n\tif err != nil {\n\t\tlog.Error(err)\n\t\tos.Exit(1)\n\t}\n\n\terr = bus.Execute(context.Background(), \u0026CreateUser{\"go-commandbus\"})\n\n\tif err != nil {\n\t\tlog.Error(err)\n\t\tos.Exit(1)\n\t}\n}\n```\n\n## License\n\nThis project is released under the MIT licence. See [LICENSE](https://github.com/lana/go-commandbus/blob/master/LICENSE) for more details.\n","funding_links":[],"categories":["Miscellaneous","杂项","Microsoft Office","Uncategorized"],"sub_categories":["Uncategorized","未分类的"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flana%2Fgo-commandbus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flana%2Fgo-commandbus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flana%2Fgo-commandbus/lists"}