Go gRPC is a simpler gRPC framework


Go gRPC makes use of go-micro plugins to create a simpler framework for gRPC development. It interoperates with standard gRPC services seamlessly, including the grpc-gateway. The go-grpc library uses the go-micro client and server plugins which make use of github.com/grpc/grpc-go. This means we ignore the go-micro codec and transport but you get a native grpc experience.


Find an example greeter service in examples/greeter.

Getting Started

Install Protobuf

Protobuf is required for code generation

You’ll need to install:

Service Discovery

Service discovery is used to resolve service names to addresses. Multicast DNS is the default, a zeroconf system. If you need something more resilient and multi-host use consul.


Consul is used as the default service discovery system. See the install guide.

Discovery is pluggable. Find plugins for etcd, kubernetes, zookeeper and more in the micro/go-plugins repo.

Pass --registry=consul to any command or the enviroment variable MICRO_REGISTRY=consul

MICRO_REGISTRY=consul go run main.go

Writing a Service

Go-grpc service is identical to a go-micro service. Which means you can swap out micro.NewService for grpc.NewService with zero other code changes.

package main

import (

	hello "github.com/micro/go-grpc/examples/greeter/server/proto/hello"

type Say struct{}

func (s *Say) Hello(ctx context.Context, req *hello.Request, rsp *hello.Response) error {
	rsp.Msg = "Hello " + req.Name
	return nil

func main() {
	service := grpc.NewService(


	hello.RegisterSayHandler(service.Server(), new(Say))

	if err := service.Run(); err != nil {

Use with Micro

You may want to use the micro toolkit with grpc services. To do this either use the prebuilt toolkit or simply include the grpc client plugin and rebuild the toolkit.

Go Get

go get github.com/micro/go-grpc/cmd/micro

Build Yourself

go get github.com/micro/micro

Create a plugins.go file

package main

import _ "github.com/micro/go-plugins/client/grpc"
import _ "github.com/micro/go-plugins/server/grpc"

Build binary

// For local use
go build -i -o micro ./main.go ./plugins.go

Flag usage of plugins

micro --client=grpc --server=grpc

Use with gRPC Gateway

Go-grpc seamlessly integrates with the gRPC ecosystem. This means the grpc-gateway can be used as per usual.

Find an example greeter api at examples/grpc/gateway.