1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-12 08:23:58 +02:00
go-micro/plugins/client/grpc
Johnson C f96b48dad9
1. use default memory registry in grpc plugins (#2317)
2. try fixing grpc plugin failed to get issue
use v4.0.0-v4.0.0-00010101000000-000000000000 instead of specific version
3. kafka panic on disconnect
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x1266c50]

goroutine 31 [running]:
github.com/asim/go-micro/plugins/broker/kafka/v3.(*kBroker).Disconnect(0xc0002400c0)
        C:/Workshop/Go/pkg/mod/github.com/asim/go-micro/plugins/broker/kafka/v3@v3.7.0/kafka.go:130 +0xd0
github.com/asim/go-micro/plugins/server/grpc/v3.(*grpcServer).Start.func2()
        C:/Workshop/Go/pkg/mod/github.com/asim/go-micro/plugins/server/grpc/v3@v3.0.0-20210712061837-0532fd9de8ae/grpc.go:998 +0xc8d
created by github.com/asim/go-micro/plugins/server/grpc/v3.(*grpcServer).Start
        C:/Workshop/Go/pkg/mod/github.com/asim/go-micro/plugins/server/grpc/v3@v3.0.0-20210712061837-0532fd9de8ae/grpc.go:917 +0xcaf
exit status 2
2021-10-22 22:30:28 +08:00
..
codec.go go-micro.dev/v4 (#2305) 2021-10-12 12:55:53 +01:00
error.go go-micro.dev/v4 (#2305) 2021-10-12 12:55:53 +01:00
go.mod 1. use default memory registry in grpc plugins (#2317) 2021-10-22 22:30:28 +08:00
go.sum 1. use default memory registry in grpc plugins (#2317) 2021-10-22 22:30:28 +08:00
grpc_pool_test.go refactor all the things 2020-12-29 15:49:26 +00:00
grpc_pool.go refactor all the things 2020-12-29 15:49:26 +00:00
grpc_test.go 1. use default memory registry in grpc plugins (#2317) 2021-10-22 22:30:28 +08:00
grpc.go go-micro.dev/v4 (#2305) 2021-10-12 12:55:53 +01:00
message.go go-micro.dev/v4 (#2305) 2021-10-12 12:55:53 +01:00
options.go go-micro.dev/v4 (#2305) 2021-10-12 12:55:53 +01:00
README.md refactor all the things 2020-12-29 15:49:26 +00:00
request_test.go refactor all the things 2020-12-29 15:49:26 +00:00
request.go go-micro.dev/v4 (#2305) 2021-10-12 12:55:53 +01:00
response.go go-micro.dev/v4 (#2305) 2021-10-12 12:55:53 +01:00
stream.go go-micro.dev/v4 (#2305) 2021-10-12 12:55:53 +01: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()),
	)
}