micro/client/grpc
Vasiliy Tolstov 58598d0fe0
fixes for safe conversation and avoid panics (#1213)
* fixes for safe convertation

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* fix client publish panic

If broker connect returns error we dont check it status and use
it later to publish message, mostly this is unexpected because
broker connection failed and we cant use it.
Also proposed solution have benefit - we flag connection status
only when we have succeseful broker connection

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* api/handler/broker: fix possible broker publish panic

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-02-18 23:05:38 +00:00
..
codec.go client/grpc: fix panic on invalid message (#1191) 2020-02-13 14:57:21 +03:00
error.go pass micro errors from grpc server to grpc client (#1167) 2020-02-06 10:18:33 +00:00
grpc_pool_test.go support streams pool for grpc (#1062) 2019-12-27 12:25:58 +00:00
grpc_pool.go Moving to gRPC by default (#1069) 2019-12-29 21:07:55 +00:00
grpc_test.go pass micro errors from grpc server to grpc client (#1167) 2020-02-06 10:18:33 +00:00
grpc.go fixes for safe conversation and avoid panics (#1213) 2020-02-18 23:05:38 +00:00
message.go fix import paths for v2 release 2020-01-30 14:44:40 +03:00
options.go fix import paths for v2 release 2020-01-30 14:44:40 +03:00
README.md Further consolidate the libraries 2019-06-03 18:44:43 +01:00
request_test.go Fix the grpc test 2019-06-19 12:34:45 +01:00
request.go fix import paths for v2 release 2020-01-30 14:44:40 +03:00
response.go fix import paths for v2 release 2020-01-30 14:44:40 +03:00
stream.go fix import paths for v2 release 2020-01-30 14:44:40 +03:00

GRPC Client

The grpc client is a micro.Client compatible client.

Overview

The client makes use of the google.golang.org/grpc framework for the underlying communication mechanism.

Usage

Specify the client to your micro service

import (
	"github.com/micro/go-micro"
	"github.com/micro/go-plugins/client/grpc"
)

func main() {
	service := micro.NewService(
		micro.Name("greeter"),
		micro.Client(grpc.NewClient()),
	)
}