Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -17,7 +17,7 @@ type testClient struct {
|
||||
name string
|
||||
}
|
||||
|
||||
func NewTestClient(name string, c client.Client) proto.TestClient {
|
||||
func NewTestClient(name string, c client.Client) TestClient {
|
||||
return &testClient{c: c, name: name}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ func (c *testClient) Call(ctx context.Context, req *proto.Request, opts ...clien
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
func (c *testClient) Stream(ctx context.Context, opts ...client.CallOption) (proto.Test_StreamClient, error) {
|
||||
func (c *testClient) Stream(ctx context.Context, opts ...client.CallOption) (Test_StreamClient, error) {
|
||||
stream, err := c.c.Stream(ctx, c.c.NewRequest(c.name, "Test.Stream", &proto.Request{}), opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -91,7 +91,7 @@ func (s *testClientStream) Recv() (*proto.Response, error) {
|
||||
}
|
||||
|
||||
type testServer struct {
|
||||
proto.TestServer
|
||||
TestServer
|
||||
}
|
||||
|
||||
func (h *testServer) Call(ctx context.Context, req *proto.Request, rsp *proto.Response) error {
|
||||
@@ -141,7 +141,7 @@ func (s *testStreamStream) Recv() (*proto.Request, error) {
|
||||
return msg, nil
|
||||
}
|
||||
|
||||
func RegisterTestServer(s server.Server, sh proto.TestServer, opts ...server.HandlerOption) error {
|
||||
func RegisterTestServer(s server.Server, sh TestServer, opts ...server.HandlerOption) error {
|
||||
type test interface {
|
||||
Call(ctx context.Context, req *proto.Request, rsp *proto.Response) error
|
||||
Stream(ctx context.Context, stream server.Stream) error
|
||||
|
@@ -15,6 +15,7 @@ import (
|
||||
"go.unistack.org/micro/v3/client"
|
||||
"go.unistack.org/micro/v3/errors"
|
||||
"go.unistack.org/micro/v3/register"
|
||||
mregister "go.unistack.org/micro/v3/register/memory"
|
||||
"go.unistack.org/micro/v3/router"
|
||||
pgrpc "google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
@@ -71,7 +72,7 @@ func TestGRPCClient(t *testing.T) {
|
||||
defer s.Stop()
|
||||
|
||||
// create mock register
|
||||
r := register.NewRegister()
|
||||
r := mregister.NewRegister()
|
||||
|
||||
// register service
|
||||
if err := r.Register(ctx, ®ister.Service{
|
||||
|
Reference in New Issue
Block a user