//GetGrpcClientConnection is used to get the client connection
GetGrpcClientConnection is used to get the client connection
// GetGrpcClientConnection is used to get the client connection
func GetGrpcClientConnection(config *config.Config) *grpc.ClientConn {
	var opts []grpc.DialOption
	opts = append(opts,
		grpc.WithUnaryInterceptor(
			grpc_opentracing.UnaryClientInterceptor(grpc_opentracing.WithTracer(jaeger.Tracer)),
		),
		grpc.WithStreamInterceptor(grpc_opentracing.StreamClientInterceptor(grpc_opentracing.WithTracer(jaeger.Tracer))),
	)
	opts = append(opts,
		grpc.WithInsecure(),
	)
	ctx, cancel := context.WithTimeout(context.Background(), time.Second*time.Duration(config.Grpc.RequestTimeout))
	defer cancel()
	conn, err := grpc.DialContext(ctx, config.Grpc.Host+":"+config.Grpc.Port, opts...)
	if err != nil {
		logger.Log.Fatal("did not connect", zap.Error(err))
	}
	return conn
}
func GetGrpcClientConnection ( config * config . Config ) * grpc . ClientConn { var opts [ ] grpc . DialOption opts = append ( opts , grpc . WithUnaryInterceptor ( grpc_opentracing . UnaryClientInterceptor ( grpc_opentracing . WithTracer ( jaeger . Tracer ) ) , ) , grpc . WithStreamInterceptor ( grpc_opentracing . StreamClientInterceptor ( grpc_opentracing . WithTracer ( jaeger . Tracer ) ) ) , ) opts = append ( opts , grpc . WithInsecure ( ) , ) ctx , cancel := context . WithTimeout ( context . Background ( ) , time . Second * time . Duration ( config . Grpc . RequestTimeout ) ) defer cancel ( ) conn , err := grpc . DialContext ( ctx , config . Grpc . Host + " " + config . Grpc . Port , opts ... ) if err != nil { logger . Log . Fatal ( " " , zap . Error ( err ) ) } return conn }
GetGrpcClientConnection is used to get the client connection
GetGrpcClientConnection is used to get the client connection
//tracing for unary interceptors //tracing for stream interceptors //append grpc insecure // You must have some sort of OpenTracing Tracer instance on hand.