All Projects → microhq → Go Plugins

microhq / Go Plugins

Licence: apache-2.0
Go Micro Plugins. Moved to go-micro/plugins.

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Go Plugins

micro-plugins
go-micro plugins, auth(JWT+Casbin)、go-micro服务加入istio服务网格
Stars: ✭ 27 (-98.37%)
Mutual labels:  micro, go-micro, micro-plugin
Go Grpc
A simpler grpc framework
Stars: ✭ 133 (-91.96%)
Mutual labels:  go-micro, micro
Gomicro note
go-micro学习笔记
Stars: ✭ 62 (-96.25%)
Mutual labels:  go-micro, micro
Go Os
Stars: ✭ 185 (-88.81%)
Mutual labels:  go-micro, micro
S
a go web freamwork for micro service, very very easy to create and deploy, with auto service registry and discover, high performance and based on http/2 no ssl
Stars: ✭ 67 (-95.95%)
Mutual labels:  go-micro, micro
micro-starter
Micro 微服务实践
Stars: ✭ 391 (-76.36%)
Mutual labels:  micro, go-micro
Micro Starter Kit
Cloud Native GoLang Microservices - gRPC, GraphQL
Stars: ✭ 167 (-89.9%)
Mutual labels:  go-micro, micro
Microservices
micro 微服务实例教程,包含JWT鉴权、熔断、监控、链路追踪、健康检查、跨域等
Stars: ✭ 341 (-79.38%)
Mutual labels:  go-micro, micro
protoc-gen-micro
Protobuf code generation
Stars: ✭ 287 (-82.65%)
Mutual labels:  micro, go-micro
backend
Backend powering the M3O platform
Stars: ✭ 64 (-96.13%)
Mutual labels:  micro, m3o
Protoc Gen Micro
Protobuf code generation for Micro. Moved to go-micro/cmd/protoc-gen-micro.
Stars: ✭ 270 (-83.68%)
Mutual labels:  go-micro, micro
Micro
go-micro 微服务实践,更多请关注Micro中国站☞
Stars: ✭ 383 (-76.84%)
Mutual labels:  go-micro, micro
Now Go
Create tinyurl/redirection service with ease.
Stars: ✭ 107 (-93.53%)
Mutual labels:  micro
Go Microservices
Examples of microservices written in Go using different frameworks
Stars: ✭ 113 (-93.17%)
Mutual labels:  go-micro
Is
Micro check library in Golang.
Stars: ✭ 61 (-96.31%)
Mutual labels:  micro
Platform Web
micro platform web dashboard 服务治理与监控平台
Stars: ✭ 104 (-93.71%)
Mutual labels:  micro
Awesome Micro
A collection of awesome things regarding zeit's micro.
Stars: ✭ 1,053 (-36.34%)
Mutual labels:  micro
Paysuper Management Api
The REST API server for the merchant`s dashboard.
Stars: ✭ 46 (-97.22%)
Mutual labels:  go-micro
Microservice learning
从零开始微服务框架使用
Stars: ✭ 31 (-98.13%)
Mutual labels:  micro
Microenvi
Bundle, serve, and hot reload with one command
Stars: ✭ 120 (-92.74%)
Mutual labels:  micro

Plugins License GoDoc Travis CI Go Report Card

Go plugins is a place for community maintained plugins.

Overview

Micro tooling is built on a powerful pluggable architecture. Plugins can be swapped out with zero code changes. This repository contains plugins for all micro related tools. Read on for further info.

Getting Started

Contents

Contents of this repository:

Directory Description
Broker PubSub messaging; NATS, NSQ, RabbitMQ, Kafka
Client RPC Clients; gRPC, HTTP
Codec Message Encoding; BSON, Mercury
Micro Micro Toolkit Plugins
Registry Service Discovery; Etcd, Gossip, NATS
Selector Load balancing; Label, Cache, Static
Server RPC Servers; gRPC, HTTP
Transport Bidirectional Streaming; NATS, RabbitMQ
Wrapper Middleware; Circuit Breakers, Rate Limiting, Tracing, Monitoring

Usage

Plugins 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.

Import the plugins in a plugins.go file

package main

import (
	_ "github.com/micro/go-plugins/broker/rabbitmq/v2"
	_ "github.com/micro/go-plugins/registry/kubernetes/v2"
	_ "github.com/micro/go-plugins/transport/nats/v2"
)

Create your service and ensure you call service.Init

package main

import (
	"github.com/micro/go-micro/v2"
)

func main() {
	service := micro.NewService(
		// Set service name
		micro.Name("my.service"),
	)

	// Parse CLI flags
	service.Init()
}

Build your service

go build -o service ./main.go ./plugins.go

Env

Use environment variables to set the

MICRO_BROKER=rabbitmq \
MICRO_REGISTRY=kubernetes \ 
MICRO_TRANSPORT=nats \ 
./service

Flags

Or use command line flags to enable them

./service --broker=rabbitmq --registry=kubernetes --transport=nats

Options

Import and set as options when creating a new service

import (
	"github.com/micro/go-micro/v2"
	"github.com/micro/go-plugins/registry/kubernetes/v2"
)

func main() {
	registry := kubernetes.NewRegistry() //a default to using env vars for master API

	service := micro.NewService(
		// Set service name
		micro.Name("my.service"),
		// Set service registry
		micro.Registry(registry),
	)
}

Build

An anti-pattern is modifying the main.go file to include plugins. Best practice recommendation is to include plugins in a separate file and rebuild with it included. This allows for automation of building plugins and clean separation of concerns.

Create file plugins.go

package main

import (
	_ "github.com/micro/go-plugins/broker/rabbitmq/v2"
	_ "github.com/micro/go-plugins/registry/kubernetes/v2"
	_ "github.com/micro/go-plugins/transport/nats/v2"
)

Build with plugins.go

go build -o service main.go plugins.go

Run with plugins

MICRO_BROKER=rabbitmq \
MICRO_REGISTRY=kubernetes \
MICRO_TRANSPORT=nats \
service
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].