{"id":20606832,"url":"https://github.com/jochumdev/microwire-plugins","last_synced_at":"2025-06-19T20:36:22.604Z","repository":{"id":60629063,"uuid":"544323685","full_name":"jochumdev/microwire-plugins","owner":"jochumdev","description":"Plugins for proof of concept microwire.","archived":false,"fork":false,"pushed_at":"2022-10-04T16:24:38.000Z","size":1714,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"v5","last_synced_at":"2025-01-17T02:40:58.568Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jochumdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-02T07:22:20.000Z","updated_at":"2022-10-12T19:32:15.000Z","dependencies_parsed_at":"2022-10-02T09:40:43.724Z","dependency_job_id":null,"html_url":"https://github.com/jochumdev/microwire-plugins","commit_stats":null,"previous_names":["go-micro/microwire-plugins"],"tags_count":631,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochumdev%2Fmicrowire-plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochumdev%2Fmicrowire-plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochumdev%2Fmicrowire-plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochumdev%2Fmicrowire-plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jochumdev","download_url":"https://codeload.github.com/jochumdev/microwire-plugins/tar.gz/refs/heads/v5","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242250928,"owners_count":20096897,"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-11-16T09:34:50.096Z","updated_at":"2025-03-06T17:18:22.273Z","avatar_url":"https://github.com/jochumdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plugins [![License](https://img.shields.io/:license-apache-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![GoDoc](https://godoc.org/github.com/go-micro/microwire-plugins?status.svg)](https://godoc.org/github.com/go-micro/microwire-plugins) [![Go Report Card](https://goreportcard.com/badge/micro/go-plugins)](https://goreportcard.com/report/github.com/go-micro/microwire-plugins) [![Visitors](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fmicrowire%2Fmicrowire-plugins\u0026count_bg=%2379C83D\u0026title_bg=%23555555\u0026icon=github.svg\u0026icon_color=%23E7E7E7\u0026title=Visitors\u0026edge_flat=false)](https://hits.seeyoufarm.com)\n\nThis repo contains the plugins for the microwire POC.\n\n## Overview\n\nMicro tooling is built on a powerful pluggable architecture. Plugins can be swapped out with zero code changes.\nThis repository contains plugins for all micro related tools. Read on for further info.\n\n## Getting Started\n\n- [Plugins](#plugins)\n\t- [Overview](#overview)\n\t- [Getting Started](#getting-started)\n\t- [Contents](#contents)\n\t- [Usage](#usage)\n\t\t- [Env](#env)\n\t\t- [Flags](#flags)\n\t\t- [Options](#options)\n\t- [Build Pattern](#build-pattern)\n\t- [Community](#community)\n\n## Contents\n\nContents of this repository:\n\n| Directory | Description                                                     |\n| --------- | ----------------------------------------------------------------|\n| Broker    | PubSub messaging; NATS, NSQ, RabbitMQ, Kafka                    |\n| Client    | RPC Clients; gRPC, HTTP                                         |\n| Codec     | Message Encoding; BSON, Mercury                                 |\n| Micro     | Micro Toolkit Plugins                                           |\n| Registry  | Service Discovery; Etcd, Gossip, NATS                           |\n| Selector  | Load balancing; Label, Cache, Static                            |\n| Server    | RPC Servers; gRPC, HTTP                                         |\n| Transport | Bidirectional Streaming; NATS, RabbitMQ                         | \n| Wrapper   | Middleware; Circuit Breakers, Rate Limiting, Tracing, Monitoring|\n\n## Usage\n\nPlugins can be added to go-micro in the following ways. By doing so they'll be available to set via command line args or environment variables.\n\nImport the plugins in a `plugins.go` file\n\n```go\npackage main\n\nimport (\n\t_ \"github.com/go-micro/microwire-plugins/broker/rabbitmq/v5\"\n\t_ \"github.com/go-micro/microwire-plugins/registry/kubernetes/v5\"\n\t_ \"github.com/go-micro/microwire-plugins/transport/nats/v5\"\n)\n```\n\nCreate your service and ensure you call `service.Init`\n\n```go\npackage main\n\nimport (\n\t\"github.com/go-micro/microwire/v5\"\n\t\"github.com/go-micro/microwire/v5/logger\"\n)\n\nfunc main() {\n\tservice, err := micro.NewService(\n\t\t// Set service name\n\t\tmicro.Name(\"my.service\"),\n\t)\n\tif err != nil {\n\t\tlogger.Fatal(err)\n\t}\n\n\t// Parse CLI flags\n\tservice.Init()\n}\n```\n\nBuild your service\n\n```\ngo build -o service ./main.go ./plugins.go\n```\n\n### Env\n\nUse environment variables to set the\n\n```\nMICRO_BROKER=rabbitmq \\\nMICRO_REGISTRY=kubernetes \\ \nMICRO_TRANSPORT=nats \\ \n./service\n```\n\n### Flags\n\nOr use command line flags to enable them\n\n```shell\n./service --broker=rabbitmq --registry=kubernetes --transport=nats\n```\n\n### Options\n\nImport and set as options when creating a new service\n\n```go\nimport (\n\t\"github.com/go-micro/microwire/v5\"\n\t\"github.com/go-micro/microwire-plugins/registry/kubernetes/v5\"\n)\n\nfunc main() {\n\tregistry := kubernetes.NewRegistry() //a default to using env vars for master API\n\n\tservice, _ := micro.NewService(\n\t\t// Set service name\n\t\tmicro.Name(\"my.service\"),\n\t\t// Set service registry\n\t\tmicro.Registry(registry),\n\t)\n}\n```\n\n## Build Pattern\n\nAn anti-pattern is modifying the `main.go` file to include plugins. Best practice recommendation is to include\nplugins in a separate file and rebuild with it included. This allows for automation of building plugins and\nclean separation of concerns.\n\nCreate file plugins.go\n\n```go\npackage main\n\nimport (\n\t_ \"github.com/go-micro/microwire-plugins/broker/rabbitmq/v5\"\n\t_ \"github.com/go-micro/microwire-plugins/registry/kubernetes/v5\"\n\t_ \"github.com/go-micro/microwire-plugins/transport/nats/v5\"\n)\n```\n\nBuild with plugins.go\n\n```shell\ngo build -o service main.go plugins.go\n```\n\nRun with plugins\n\n```shell\nMICRO_BROKER=rabbitmq \\\nMICRO_REGISTRY=kubernetes \\\nMICRO_TRANSPORT=nats \\\nservice\n```\n\n## Community\n\n- [Discord](https://discord.gg/qV3HvnEJfB)\n- [Slack](https://join.slack.com/t/go-micro/shared_invite/zt-175aaev1d-iHExPTlfxvfkOeeKLIYEYw)\n- [QQ Group](https://jq.qq.com/?_wv=1027\u0026k=5Gmrfv9i)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjochumdev%2Fmicrowire-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjochumdev%2Fmicrowire-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjochumdev%2Fmicrowire-plugins/lists"}