{"id":13288485,"url":"https://github.com/spiral-modules/asyncapi-go-template","last_synced_at":"2025-03-10T06:33:33.814Z","repository":{"id":64494465,"uuid":"576202373","full_name":"spiral-modules/asyncapi-go-template","owner":"spiral-modules","description":"🌠 This template generates Go structures as a package for building event-driven applications","archived":true,"fork":false,"pushed_at":"2023-04-01T14:00:51.000Z","size":263,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T18:58:09.793Z","etag":null,"topics":["asyncapi","generator","go","golang","template"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/spiral-modules.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-09T08:51:23.000Z","updated_at":"2024-08-02T14:15:12.000Z","dependencies_parsed_at":"2024-07-29T16:59:31.293Z","dependency_job_id":"331accd2-e12a-4c7f-9ab8-6b06f17687c4","html_url":"https://github.com/spiral-modules/asyncapi-go-template","commit_stats":null,"previous_names":["spiral-modules/asyncapi-go-template"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiral-modules%2Fasyncapi-go-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiral-modules%2Fasyncapi-go-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiral-modules%2Fasyncapi-go-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spiral-modules%2Fasyncapi-go-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spiral-modules","download_url":"https://codeload.github.com/spiral-modules/asyncapi-go-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242805420,"owners_count":20187995,"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":["asyncapi","generator","go","golang","template"],"created_at":"2024-07-29T16:56:55.122Z","updated_at":"2025-03-10T06:33:31.144Z","avatar_url":"https://github.com/spiral-modules.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![AsyncAPI logo](https://user-images.githubusercontent.com/7326800/206534082-36d7caf2-a14e-4c80-bf66-9005142c1bb8.png)\n\n![release][badge-release]\n[![tests][badge-ci-tests]][actions]\n[![release][badge-ci-release]][actions]\n![license][badge-license]\n\n\u003c/div\u003e\n\n## Overview\n\nThis template generates Go structures as a package for building event-driven applications.\n\n## Template Output\n\nThe `go` code generated by this template has the following structure:\n\n- `channels.gen.go` - contains all the channels defined in the AsyncAPI document.\n- `payloads.gen.go` - contains all the payloads.\n- `servers.gen.go` - contains servers addresses.\n- `version.gen.go` - contains version constants.\n\nWatch the example output in the [example](example/generated) directory.\n\n## Technical requirements\n\n- 1.1.0 =\u003c [Generator](https://github.com/asyncapi/generator/) \u003c 2.0.0\n- Generator specific [requirements](https://github.com/asyncapi/generator/#requirements)\n\n## How to use the template\n\nThis template must be used with the AsyncAPI Generator. You can find all available options [here](https://github.com/asyncapi/generator/).\n\n### Run the following command to generate a Go package\n\n```bash\n$ npm install -g @asyncapi/generator\n# clone this repository and navigate to this repository\n$ ag ./example/asyncapi.yaml ./ -o ./example/generated -p packageName=your_go_package_name\n```\n\nFollowing are the options that can be passed to the generator\n\n1. `packageName`: name of the go package to be generated\n\n### Docker usage\n\nAdditionally, you can use the docker image:\n\n| Registry                          | Image                                 |\n|-----------------------------------|---------------------------------------|\n| [GitHub Container Registry][ghcr] | `ghcr.io/spiral/asyncapi-go-template` |\n\n\u003e Using the `latest` tag for the docker image is highly discouraged because of possible backward-incompatible changes\n\u003e during **major** upgrades. Please, use tags in `X.Y.Z` format\n\n```bash\n$ docker run --rm -u \"$(id -u):$(id -g)\" -v \"${PWD}:/host:rw\" -w \"/host\" \\\n    ghcr.io/spiral/asyncapi-go-template ./example/asyncapi.yaml @spiral/asyncapi-go-template \\\n      -o ./example/generated \\\n      -p packageName=your_go_package_name \\\n      --force-write\n```\n\nIn addition, the docker image contains installed [`@asyncapi/markdown-template`][md-template] and [`@asyncapi/html-template`][html-template]. You can use them to generate documentation for your AsyncAPI document.\n\n[md-template]:https://github.com/asyncapi/markdown-template\n[html-template]:https://github.com/asyncapi/html-template\n\n## Template configuration\n\nYou can configure this template by passing different parameters in the Generator CLI: `-p PARAM1_NAME=PARAM1_VALUE -p PARAM2_NAME=PARAM2_VALUE`\n\n| Name          | Description                       | Required | Example    |\n|---------------|-----------------------------------|----------|------------|\n| `packageName` | Name for the generated Go package | false    | `asyncapi` |\n\n## Releasing\n\nNew versions publishing is very simple - just make required changes in this repository, update [changelog file](CHANGELOG.md) and \"publish\" new release using repo releases page.\n\nDocker image \u0026 npm package will be build and published automatically.\n\n\u003e New release will overwrite the `latest` docker image tag.\n\n[badge-release]:https://img.shields.io/github/v/release/spiral/asyncapi-go-template?style=flat-square\n[badge-npm-version]:https://img.shields.io/npm/v/@spiral/asyncapi-go-template?maxAge=30\u0026style=flat-square\n[badge-ci-tests]:https://img.shields.io/github/workflow/status/spiral/asyncapi-go-template/tests?maxAge=30\u0026label=tests\u0026logo=github\u0026style=flat-square\n[badge-ci-release]:https://img.shields.io/github/workflow/status/spiral/asyncapi-go-template/release?maxAge=30\u0026label=release\u0026logo=github\u0026style=flat-square\n[badge-license]:https://img.shields.io/github/license/spiral/asyncapi-go-template.svg?maxAge=30\u0026style=flat-square\n[actions]:https://github.com/spiral/asyncapi-go-template/actions\n[ghcr]:https://github.com/spiral/asyncapi-go-template/pkgs/container/asyncapi-go-template\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspiral-modules%2Fasyncapi-go-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspiral-modules%2Fasyncapi-go-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspiral-modules%2Fasyncapi-go-template/lists"}