diff --git a/interop/client/client.go b/interop/client/client.go index cc0f76fe..40dfe190 100644 --- a/interop/client/client.go +++ b/interop/client/client.go @@ -44,7 +44,7 @@ import ( "golang.org/x/net/context" "google.golang.org/grpc" "google.golang.org/grpc/credentials" - testpb "google.golang.org/grpc/interop/testdata" + testpb "google.golang.org/grpc/interop/grpc_testing" ) var ( diff --git a/interop/testdata/messages.proto b/interop/grpc_testing/messages.proto similarity index 100% rename from interop/testdata/messages.proto rename to interop/grpc_testing/messages.proto diff --git a/interop/testdata/test.proto b/interop/grpc_testing/test.proto similarity index 100% rename from interop/testdata/test.proto rename to interop/grpc_testing/test.proto diff --git a/interop/testdata/test_proto.pb.go b/interop/grpc_testing/test_proto.pb.go similarity index 100% rename from interop/testdata/test_proto.pb.go rename to interop/grpc_testing/test_proto.pb.go diff --git a/interop/testdata/test_proto_grpc.pb.go b/interop/grpc_testing/test_proto_grpc.pb.go similarity index 100% rename from interop/testdata/test_proto_grpc.pb.go rename to interop/grpc_testing/test_proto_grpc.pb.go diff --git a/interop/server/server.go b/interop/server/server.go index 8bfd37d9..d34b794a 100644 --- a/interop/server/server.go +++ b/interop/server/server.go @@ -46,7 +46,7 @@ import ( "golang.org/x/net/context" "google.golang.org/grpc" "google.golang.org/grpc/credentials" - testpb "google.golang.org/grpc/interop/testdata" + testpb "google.golang.org/grpc/interop/grpc_testing" ) var ( diff --git a/test/end2end_test.go b/test/end2end_test.go index 5d8c5001..9c49282a 100644 --- a/test/end2end_test.go +++ b/test/end2end_test.go @@ -52,7 +52,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/metadata" - testpb "google.golang.org/grpc/test/testdata" + testpb "google.golang.org/grpc/test/proto" ) var ( diff --git a/test/testdata/test.pb.go b/test/proto/test.pb.go similarity index 87% rename from test/testdata/test.pb.go rename to test/proto/test.pb.go index 46fa1d3f..6c81859f 100644 --- a/test/testdata/test.pb.go +++ b/test/proto/test.pb.go @@ -32,14 +32,14 @@ */ // Code generated by protoc-gen-go. -// source: test.proto +// source: src/google.golang.org/grpc/test/proto/test.proto // DO NOT EDIT! /* -Package test is a generated protocol buffer package. +Package proto is a generated protocol buffer package. It is generated from these files: - test.proto + src/google.golang.org/grpc/test/proto/test.proto It has these top-level messages: DivArgs @@ -48,13 +48,13 @@ It has these top-level messages: Num FibReply */ -package test +package proto -import proto "github.com/golang/protobuf/proto" +import proto1 "github.com/golang/protobuf/proto" import math "math" // Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal +var _ = proto1.Marshal var _ = math.Inf type DivArgs struct { @@ -64,7 +64,7 @@ type DivArgs struct { } func (m *DivArgs) Reset() { *m = DivArgs{} } -func (m *DivArgs) String() string { return proto.CompactTextString(m) } +func (m *DivArgs) String() string { return proto1.CompactTextString(m) } func (*DivArgs) ProtoMessage() {} func (m *DivArgs) GetDividend() int64 { @@ -88,7 +88,7 @@ type DivReply struct { } func (m *DivReply) Reset() { *m = DivReply{} } -func (m *DivReply) String() string { return proto.CompactTextString(m) } +func (m *DivReply) String() string { return proto1.CompactTextString(m) } func (*DivReply) ProtoMessage() {} func (m *DivReply) GetQuotient() int64 { @@ -111,7 +111,7 @@ type FibArgs struct { } func (m *FibArgs) Reset() { *m = FibArgs{} } -func (m *FibArgs) String() string { return proto.CompactTextString(m) } +func (m *FibArgs) String() string { return proto1.CompactTextString(m) } func (*FibArgs) ProtoMessage() {} func (m *FibArgs) GetLimit() int64 { @@ -127,7 +127,7 @@ type Num struct { } func (m *Num) Reset() { *m = Num{} } -func (m *Num) String() string { return proto.CompactTextString(m) } +func (m *Num) String() string { return proto1.CompactTextString(m) } func (*Num) ProtoMessage() {} func (m *Num) GetNum() int64 { @@ -143,7 +143,7 @@ type FibReply struct { } func (m *FibReply) Reset() { *m = FibReply{} } -func (m *FibReply) String() string { return proto.CompactTextString(m) } +func (m *FibReply) String() string { return proto1.CompactTextString(m) } func (*FibReply) ProtoMessage() {} func (m *FibReply) GetCount() int64 { diff --git a/test/testdata/test.proto b/test/proto/test.proto similarity index 96% rename from test/testdata/test.proto rename to test/proto/test.proto index 4e72cf87..dc86cd0e 100644 --- a/test/testdata/test.proto +++ b/test/proto/test.proto @@ -1,8 +1,6 @@ syntax = "proto2"; -package test; - -option go_package = "test"; +package proto; message DivArgs { required int64 dividend = 1; diff --git a/test/testdata/test_grpc.pb.go b/test/proto/test_grpc.pb.go similarity index 92% rename from test/testdata/test_grpc.pb.go rename to test/proto/test_grpc.pb.go index 5192d299..1f480b24 100644 --- a/test/testdata/test_grpc.pb.go +++ b/test/proto/test_grpc.pb.go @@ -31,16 +31,17 @@ * */ -package test +package proto import ( "fmt" - proto "github.com/golang/protobuf/proto" - context "golang.org/x/net/context" - "google.golang.org/grpc" "io" + "google.golang.org/grpc" + context "golang.org/x/net/context" + proto "github.com/golang/protobuf/proto" ) + type MathClient interface { Div(ctx context.Context, in *DivArgs, opts ...grpc.CallOption) (*DivReply, error) DivMany(ctx context.Context, opts ...grpc.CallOption) (Math_DivManyClient, error) @@ -58,7 +59,7 @@ func NewMathClient(cc *grpc.ClientConn) MathClient { func (c *mathClient) Div(ctx context.Context, in *DivArgs, opts ...grpc.CallOption) (*DivReply, error) { out := new(DivReply) - err := grpc.Invoke(ctx, "/test.Math/Div", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/proto.Math/Div", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -66,7 +67,7 @@ func (c *mathClient) Div(ctx context.Context, in *DivArgs, opts ...grpc.CallOpti } func (c *mathClient) DivMany(ctx context.Context, opts ...grpc.CallOption) (Math_DivManyClient, error) { - stream, err := grpc.NewClientStream(ctx, c.cc, "/test.Math/DivMany", opts...) + stream, err := grpc.NewClientStream(ctx, c.cc, "/proto.Math/DivMany", opts...) if err != nil { return nil, err } @@ -96,7 +97,7 @@ func (x *mathDivManyClient) Recv() (*DivReply, error) { } func (c *mathClient) Fib(ctx context.Context, m *FibArgs, opts ...grpc.CallOption) (Math_FibClient, error) { - stream, err := grpc.NewClientStream(ctx, c.cc, "/test.Math/Fib", opts...) + stream, err := grpc.NewClientStream(ctx, c.cc, "/proto.Math/Fib", opts...) if err != nil { return nil, err } @@ -128,7 +129,7 @@ func (x *mathFibClient) Recv() (*Num, error) { } func (c *mathClient) Sum(ctx context.Context, opts ...grpc.CallOption) (Math_SumClient, error) { - stream, err := grpc.NewClientStream(ctx, c.cc, "/test.Math/Sum", opts...) + stream, err := grpc.NewClientStream(ctx, c.cc, "/proto.Math/Sum", opts...) if err != nil { return nil, err } @@ -165,6 +166,7 @@ func (x *mathSumClient) CloseAndRecv() (*Num, error) { return m, fmt.Errorf("Violate gRPC client streaming protocol: no EOF after the response.") } + type MathServer interface { Div(context.Context, *DivArgs) (*DivReply, error) DivMany(Math_DivManyServer) error @@ -265,26 +267,28 @@ func (x *mathSumServer) Recv() (*Num, error) { } var _Math_serviceDesc = grpc.ServiceDesc{ - ServiceName: "test.Math", + ServiceName: "proto.Math", HandlerType: (*MathServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "Div", - Handler: _Math_Div_Handler, + MethodName: "Div", + Handler: _Math_Div_Handler, }, }, Streams: []grpc.StreamDesc{ { - StreamName: "DivMany", - Handler: _Math_DivMany_Handler, + StreamName: "DivMany", + Handler: _Math_DivMany_Handler, }, { - StreamName: "Fib", - Handler: _Math_Fib_Handler, + StreamName: "Fib", + Handler: _Math_Fib_Handler, }, { - StreamName: "Sum", - Handler: _Math_Sum_Handler, + StreamName: "Sum", + Handler: _Math_Sum_Handler, }, }, } + +