{"id":37169208,"url":"https://github.com/printfcoder/go-plugins","last_synced_at":"2026-01-14T19:59:02.037Z","repository":{"id":57484218,"uuid":"296289541","full_name":"printfcoder/go-plugins","owner":"printfcoder","description":"Plugins for external infrastructure dependencies","archived":false,"fork":true,"pushed_at":"2020-09-17T12:44:20.000Z","size":5175,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-21T04:39:47.612Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"st3v/go-plugins","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/printfcoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"asim"}},"created_at":"2020-09-17T10:07:52.000Z","updated_at":"2020-12-27T12:34:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/printfcoder/go-plugins","commit_stats":null,"previous_names":[],"tags_count":100,"template":false,"template_full_name":null,"purl":"pkg:github/printfcoder/go-plugins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/printfcoder%2Fgo-plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/printfcoder%2Fgo-plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/printfcoder%2Fgo-plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/printfcoder%2Fgo-plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/printfcoder","download_url":"https://codeload.github.com/printfcoder/go-plugins/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/printfcoder%2Fgo-plugins/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28433966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2026-01-14T19:59:01.314Z","updated_at":"2026-01-14T19:59:02.032Z","avatar_url":"https://github.com/printfcoder.png","language":"Go","funding_links":["https://github.com/sponsors/asim"],"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/micro/go-plugins?status.svg)](https://godoc.org/github.com/micro/go-plugins) [![Travis CI](https://travis-ci.org/micro/go-plugins.svg?branch=master)](https://travis-ci.org/micro/go-plugins) [![Go Report Card](https://goreportcard.com/badge/micro/go-plugins)](https://goreportcard.com/report/github.com/micro/go-plugins)\n\nGo plugins is a place for community maintained plugins.\n\n## Overview\n\nMicro is built as a pluggable framework using Go interfaces. Plugins enable you to swap out the underlying infrastructure without having \nto rewrite all your code. This enables running the same software in multiple environments without a ton of work. Read further for more info.\n\n## Getting Started\n\n* [Contents](#contents)\n* [Usage](#usage)\n* [Build](#build)\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/micro/go-plugins/broker/rabbitmq/v2\"\n\t_ \"github.com/micro/go-plugins/registry/kubernetes/v2\"\n\t_ \"github.com/micro/go-plugins/transport/nats/v2\"\n)\n```\n\nCreate your service and ensure you call `service.Init`\n\n```go\npackage main\n\nimport (\n\t\"github.com/micro/go-micro/v2\"\n)\n\nfunc main() {\n\tservice := micro.NewService(\n\t\t// Set service name\n\t\tmicro.Name(\"my.service\"),\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### Environment Variables\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/micro/go-micro/v2\"\n\t\"github.com/micro/go-plugins/registry/kubernetes/v2\"\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\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/micro/go-plugins/broker/rabbitmq/v2\"\n\t_ \"github.com/micro/go-plugins/registry/kubernetes/v2\"\n\t_ \"github.com/micro/go-plugins/transport/nats/v2\"\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprintfcoder%2Fgo-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprintfcoder%2Fgo-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprintfcoder%2Fgo-plugins/lists"}