10
									
								
								codec.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								codec.go
									
									
									
									
									
								
							| @@ -11,8 +11,6 @@ import ( | ||||
| 	jsoniter "github.com/json-iterator/go" | ||||
| 	"github.com/micro/go-micro/codec" | ||||
| 	"github.com/micro/go-micro/codec/bytes" | ||||
| 	"github.com/micro/go-micro/codec/jsonrpc" | ||||
| 	"github.com/micro/go-micro/codec/protorpc" | ||||
| 	"google.golang.org/grpc" | ||||
| 	"google.golang.org/grpc/encoding" | ||||
| ) | ||||
| @@ -36,14 +34,6 @@ var ( | ||||
| 		"application/grpc+bytes":   bytesCodec{}, | ||||
| 	} | ||||
|  | ||||
| 	defaultRPCCodecs = map[string]codec.NewCodec{ | ||||
| 		"application/json":         jsonrpc.NewCodec, | ||||
| 		"application/json-rpc":     jsonrpc.NewCodec, | ||||
| 		"application/protobuf":     protorpc.NewCodec, | ||||
| 		"application/proto-rpc":    protorpc.NewCodec, | ||||
| 		"application/octet-stream": protorpc.NewCodec, | ||||
| 	} | ||||
|  | ||||
| 	json = jsoniter.ConfigCompatibleWithStandardLibrary | ||||
| ) | ||||
|  | ||||
|   | ||||
							
								
								
									
										10
									
								
								grpc.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								grpc.go
									
									
									
									
									
								
							| @@ -282,16 +282,6 @@ func (g *grpcClient) newGRPCCodec(contentType string) (encoding.Codec, error) { | ||||
| 	return nil, fmt.Errorf("Unsupported Content-Type: %s", contentType) | ||||
| } | ||||
|  | ||||
| func (g *grpcClient) newCodec(contentType string) (codec.NewCodec, error) { | ||||
| 	if c, ok := g.opts.Codecs[contentType]; ok { | ||||
| 		return c, nil | ||||
| 	} | ||||
| 	if cf, ok := defaultRPCCodecs[contentType]; ok { | ||||
| 		return cf, nil | ||||
| 	} | ||||
| 	return nil, fmt.Errorf("Unsupported Content-Type: %s", contentType) | ||||
| } | ||||
|  | ||||
| func (g *grpcClient) Init(opts ...client.Option) error { | ||||
| 	size := g.opts.PoolSize | ||||
| 	ttl := g.opts.PoolTTL | ||||
|   | ||||
| @@ -1,11 +1,11 @@ | ||||
| package grpc | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"net" | ||||
| 	"testing" | ||||
| 	"time" | ||||
|  | ||||
| 	"context" | ||||
| 	"google.golang.org/grpc" | ||||
| 	pgrpc "google.golang.org/grpc" | ||||
| 	pb "google.golang.org/grpc/examples/helloworld/helloworld" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user