Skip to content

Compatibility with native gRPC client #3

Description

@alexmt

Proposal

Generate REST client that implements native gRPC client interface.

Motivation

The generated API client is great. However, it is slightly different from the native gRPC client interface.

  • grpc-gateway client interface:
// GreeterGatewayClient is the interface for Greeter service client.
type GreeterGatewayClient interface {
	// Sends a greeting
	SayHello(context.Context, *HelloRequest) (*HelloReply, error)
}
  • native grpc client
type GreeterClient interface {
	// Sends a greeting
	SayHello(context.Context, *HelloRequest,  ...grpc.CallOption) (*HelloReply, error)
}

If grpc-gateway client uses the same interface as native gRPC then it can be used as a drop-in replacement, making adoption much easier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions