mirror of https://github.com/grpc/grpc-go.git
Use proto3 in interop tests and end2end tests (#1574)
This commit is contained in:
parent
90947a8e84
commit
5131c1f096
|
@ -64,26 +64,12 @@ var PayloadType_value = map[string]int32{
|
|||
"RANDOM": 2,
|
||||
}
|
||||
|
||||
func (x PayloadType) Enum() *PayloadType {
|
||||
p := new(PayloadType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x PayloadType) String() string {
|
||||
return proto.EnumName(PayloadType_name, int32(x))
|
||||
}
|
||||
func (x *PayloadType) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(PayloadType_value, data, "PayloadType")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = PayloadType(value)
|
||||
return nil
|
||||
}
|
||||
func (PayloadType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
||||
|
||||
type Empty struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Empty) Reset() { *m = Empty{} }
|
||||
|
@ -94,10 +80,9 @@ func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
|||
// A block of data, to simply increase gRPC message size.
|
||||
type Payload struct {
|
||||
// The type of data in body.
|
||||
Type *PayloadType `protobuf:"varint,1,opt,name=type,enum=grpc.testing.PayloadType" json:"type,omitempty"`
|
||||
Type PayloadType `protobuf:"varint,1,opt,name=type,enum=grpc.testing.PayloadType" json:"type,omitempty"`
|
||||
// Primary contents of payload.
|
||||
Body []byte `protobuf:"bytes,2,opt,name=body" json:"body,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Payload) Reset() { *m = Payload{} }
|
||||
|
@ -106,8 +91,8 @@ func (*Payload) ProtoMessage() {}
|
|||
func (*Payload) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
||||
|
||||
func (m *Payload) GetType() PayloadType {
|
||||
if m != nil && m.Type != nil {
|
||||
return *m.Type
|
||||
if m != nil {
|
||||
return m.Type
|
||||
}
|
||||
return PayloadType_COMPRESSABLE
|
||||
}
|
||||
|
@ -122,9 +107,8 @@ func (m *Payload) GetBody() []byte {
|
|||
// A protobuf representation for grpc status. This is used by test
|
||||
// clients to specify a status that the server should attempt to return.
|
||||
type EchoStatus struct {
|
||||
Code *int32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"`
|
||||
Message *string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
Code int32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"`
|
||||
Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
|
||||
}
|
||||
|
||||
func (m *EchoStatus) Reset() { *m = EchoStatus{} }
|
||||
|
@ -133,15 +117,15 @@ func (*EchoStatus) ProtoMessage() {}
|
|||
func (*EchoStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
|
||||
|
||||
func (m *EchoStatus) GetCode() int32 {
|
||||
if m != nil && m.Code != nil {
|
||||
return *m.Code
|
||||
if m != nil {
|
||||
return m.Code
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *EchoStatus) GetMessage() string {
|
||||
if m != nil && m.Message != nil {
|
||||
return *m.Message
|
||||
if m != nil {
|
||||
return m.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
@ -150,19 +134,18 @@ func (m *EchoStatus) GetMessage() string {
|
|||
type SimpleRequest struct {
|
||||
// Desired payload type in the response from the server.
|
||||
// If response_type is RANDOM, server randomly chooses one from other formats.
|
||||
ResponseType *PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,enum=grpc.testing.PayloadType" json:"response_type,omitempty"`
|
||||
ResponseType PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,enum=grpc.testing.PayloadType" json:"response_type,omitempty"`
|
||||
// Desired payload size in the response from the server.
|
||||
// If response_type is COMPRESSABLE, this denotes the size before compression.
|
||||
ResponseSize *int32 `protobuf:"varint,2,opt,name=response_size,json=responseSize" json:"response_size,omitempty"`
|
||||
ResponseSize int32 `protobuf:"varint,2,opt,name=response_size,json=responseSize" json:"response_size,omitempty"`
|
||||
// Optional input payload sent along with the request.
|
||||
Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"`
|
||||
// Whether SimpleResponse should include username.
|
||||
FillUsername *bool `protobuf:"varint,4,opt,name=fill_username,json=fillUsername" json:"fill_username,omitempty"`
|
||||
FillUsername bool `protobuf:"varint,4,opt,name=fill_username,json=fillUsername" json:"fill_username,omitempty"`
|
||||
// Whether SimpleResponse should include OAuth scope.
|
||||
FillOauthScope *bool `protobuf:"varint,5,opt,name=fill_oauth_scope,json=fillOauthScope" json:"fill_oauth_scope,omitempty"`
|
||||
FillOauthScope bool `protobuf:"varint,5,opt,name=fill_oauth_scope,json=fillOauthScope" json:"fill_oauth_scope,omitempty"`
|
||||
// Whether server should return a given status
|
||||
ResponseStatus *EchoStatus `protobuf:"bytes,7,opt,name=response_status,json=responseStatus" json:"response_status,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
ResponseStatus *EchoStatus `protobuf:"bytes,7,opt,name=response_status,json=responseStatus" json:"response_status,omitempty"`
|
||||
}
|
||||
|
||||
func (m *SimpleRequest) Reset() { *m = SimpleRequest{} }
|
||||
|
@ -171,15 +154,15 @@ func (*SimpleRequest) ProtoMessage() {}
|
|||
func (*SimpleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
|
||||
|
||||
func (m *SimpleRequest) GetResponseType() PayloadType {
|
||||
if m != nil && m.ResponseType != nil {
|
||||
return *m.ResponseType
|
||||
if m != nil {
|
||||
return m.ResponseType
|
||||
}
|
||||
return PayloadType_COMPRESSABLE
|
||||
}
|
||||
|
||||
func (m *SimpleRequest) GetResponseSize() int32 {
|
||||
if m != nil && m.ResponseSize != nil {
|
||||
return *m.ResponseSize
|
||||
if m != nil {
|
||||
return m.ResponseSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
@ -192,15 +175,15 @@ func (m *SimpleRequest) GetPayload() *Payload {
|
|||
}
|
||||
|
||||
func (m *SimpleRequest) GetFillUsername() bool {
|
||||
if m != nil && m.FillUsername != nil {
|
||||
return *m.FillUsername
|
||||
if m != nil {
|
||||
return m.FillUsername
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *SimpleRequest) GetFillOauthScope() bool {
|
||||
if m != nil && m.FillOauthScope != nil {
|
||||
return *m.FillOauthScope
|
||||
if m != nil {
|
||||
return m.FillOauthScope
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
@ -218,10 +201,9 @@ type SimpleResponse struct {
|
|||
Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"`
|
||||
// The user the request came from, for verifying authentication was
|
||||
// successful when the client expected it.
|
||||
Username *string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"`
|
||||
Username string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"`
|
||||
// OAuth scope.
|
||||
OauthScope *string `protobuf:"bytes,3,opt,name=oauth_scope,json=oauthScope" json:"oauth_scope,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
OauthScope string `protobuf:"bytes,3,opt,name=oauth_scope,json=oauthScope" json:"oauth_scope,omitempty"`
|
||||
}
|
||||
|
||||
func (m *SimpleResponse) Reset() { *m = SimpleResponse{} }
|
||||
|
@ -237,15 +219,15 @@ func (m *SimpleResponse) GetPayload() *Payload {
|
|||
}
|
||||
|
||||
func (m *SimpleResponse) GetUsername() string {
|
||||
if m != nil && m.Username != nil {
|
||||
return *m.Username
|
||||
if m != nil {
|
||||
return m.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *SimpleResponse) GetOauthScope() string {
|
||||
if m != nil && m.OauthScope != nil {
|
||||
return *m.OauthScope
|
||||
if m != nil {
|
||||
return m.OauthScope
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
@ -253,8 +235,7 @@ func (m *SimpleResponse) GetOauthScope() string {
|
|||
// Client-streaming request.
|
||||
type StreamingInputCallRequest struct {
|
||||
// Optional input payload sent along with the request.
|
||||
Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"`
|
||||
}
|
||||
|
||||
func (m *StreamingInputCallRequest) Reset() { *m = StreamingInputCallRequest{} }
|
||||
|
@ -272,8 +253,7 @@ func (m *StreamingInputCallRequest) GetPayload() *Payload {
|
|||
// Client-streaming response.
|
||||
type StreamingInputCallResponse struct {
|
||||
// Aggregated size of payloads received from the client.
|
||||
AggregatedPayloadSize *int32 `protobuf:"varint,1,opt,name=aggregated_payload_size,json=aggregatedPayloadSize" json:"aggregated_payload_size,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
AggregatedPayloadSize int32 `protobuf:"varint,1,opt,name=aggregated_payload_size,json=aggregatedPayloadSize" json:"aggregated_payload_size,omitempty"`
|
||||
}
|
||||
|
||||
func (m *StreamingInputCallResponse) Reset() { *m = StreamingInputCallResponse{} }
|
||||
|
@ -282,8 +262,8 @@ func (*StreamingInputCallResponse) ProtoMessage() {}
|
|||
func (*StreamingInputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
|
||||
|
||||
func (m *StreamingInputCallResponse) GetAggregatedPayloadSize() int32 {
|
||||
if m != nil && m.AggregatedPayloadSize != nil {
|
||||
return *m.AggregatedPayloadSize
|
||||
if m != nil {
|
||||
return m.AggregatedPayloadSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
@ -292,11 +272,10 @@ func (m *StreamingInputCallResponse) GetAggregatedPayloadSize() int32 {
|
|||
type ResponseParameters struct {
|
||||
// Desired payload sizes in responses from the server.
|
||||
// If response_type is COMPRESSABLE, this denotes the size before compression.
|
||||
Size *int32 `protobuf:"varint,1,opt,name=size" json:"size,omitempty"`
|
||||
Size int32 `protobuf:"varint,1,opt,name=size" json:"size,omitempty"`
|
||||
// Desired interval between consecutive responses in the response stream in
|
||||
// microseconds.
|
||||
IntervalUs *int32 `protobuf:"varint,2,opt,name=interval_us,json=intervalUs" json:"interval_us,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
IntervalUs int32 `protobuf:"varint,2,opt,name=interval_us,json=intervalUs" json:"interval_us,omitempty"`
|
||||
}
|
||||
|
||||
func (m *ResponseParameters) Reset() { *m = ResponseParameters{} }
|
||||
|
@ -305,15 +284,15 @@ func (*ResponseParameters) ProtoMessage() {}
|
|||
func (*ResponseParameters) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
|
||||
|
||||
func (m *ResponseParameters) GetSize() int32 {
|
||||
if m != nil && m.Size != nil {
|
||||
return *m.Size
|
||||
if m != nil {
|
||||
return m.Size
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ResponseParameters) GetIntervalUs() int32 {
|
||||
if m != nil && m.IntervalUs != nil {
|
||||
return *m.IntervalUs
|
||||
if m != nil {
|
||||
return m.IntervalUs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
@ -324,14 +303,13 @@ type StreamingOutputCallRequest struct {
|
|||
// If response_type is RANDOM, the payload from each response in the stream
|
||||
// might be of different types. This is to simulate a mixed type of payload
|
||||
// stream.
|
||||
ResponseType *PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,enum=grpc.testing.PayloadType" json:"response_type,omitempty"`
|
||||
ResponseType PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,enum=grpc.testing.PayloadType" json:"response_type,omitempty"`
|
||||
// Configuration for each expected response message.
|
||||
ResponseParameters []*ResponseParameters `protobuf:"bytes,2,rep,name=response_parameters,json=responseParameters" json:"response_parameters,omitempty"`
|
||||
// Optional input payload sent along with the request.
|
||||
Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"`
|
||||
// Whether server should return a given status
|
||||
ResponseStatus *EchoStatus `protobuf:"bytes,7,opt,name=response_status,json=responseStatus" json:"response_status,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
ResponseStatus *EchoStatus `protobuf:"bytes,7,opt,name=response_status,json=responseStatus" json:"response_status,omitempty"`
|
||||
}
|
||||
|
||||
func (m *StreamingOutputCallRequest) Reset() { *m = StreamingOutputCallRequest{} }
|
||||
|
@ -340,8 +318,8 @@ func (*StreamingOutputCallRequest) ProtoMessage() {}
|
|||
func (*StreamingOutputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
|
||||
|
||||
func (m *StreamingOutputCallRequest) GetResponseType() PayloadType {
|
||||
if m != nil && m.ResponseType != nil {
|
||||
return *m.ResponseType
|
||||
if m != nil {
|
||||
return m.ResponseType
|
||||
}
|
||||
return PayloadType_COMPRESSABLE
|
||||
}
|
||||
|
@ -370,8 +348,7 @@ func (m *StreamingOutputCallRequest) GetResponseStatus() *EchoStatus {
|
|||
// Server-streaming response, as configured by the request and parameters.
|
||||
type StreamingOutputCallResponse struct {
|
||||
// Payload to increase response size.
|
||||
Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"`
|
||||
}
|
||||
|
||||
func (m *StreamingOutputCallResponse) Reset() { *m = StreamingOutputCallResponse{} }
|
||||
|
@ -860,46 +837,47 @@ var _UnimplementedService_serviceDesc = grpc.ServiceDesc{
|
|||
func init() { proto.RegisterFile("grpc_testing/test.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 656 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0x4d, 0x6f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0xaa, 0x7f, 0x2f, 0xc1,
|
||||
0xaa, 0xe5, 0x78, 0xa1, 0x4b, 0x26, 0x7d, 0x4e, 0x28, 0xe6, 0xf8, 0x16, 0x56, 0x23, 0x8a, 0xc3,
|
||||
0xc0, 0x8f, 0x69, 0x70, 0xb3, 0xce, 0xea, 0x39, 0x5f, 0xdc, 0xf0, 0x71, 0x21, 0x3f, 0x76, 0x2e,
|
||||
0xd3, 0x17, 0x2b, 0x53, 0x92, 0xe5, 0x5c, 0x12, 0x6e, 0x43, 0x35, 0x4c, 0x2b, 0x68, 0x4b, 0x2d,
|
||||
0xc5, 0xa8, 0x75, 0xd6, 0x17, 0x96, 0x37, 0x73, 0x96, 0xa8, 0x7a, 0xe6, 0xb8, 0xee, 0x20, 0x89,
|
||||
0x29, 0xf2, 0x99, 0x47, 0x5a, 0xb9, 0xa5, 0x18, 0xcb, 0x66, 0x5d, 0x80, 0xfd, 0x0c, 0x43, 0x03,
|
||||
0x1a, 0x92, 0x14, 0xb0, 0x84, 0x9f, 0x0f, 0xe2, 0x61, 0x10, 0x92, 0x56, 0x91, 0x3c, 0x55, 0xe0,
|
||||
0x3d, 0x01, 0x5b, 0x02, 0xc5, 0x1d, 0xb8, 0x37, 0x6d, 0x52, 0xce, 0x4d, 0xab, 0xca, 0x3e, 0xb4,
|
||||
0xd9, 0x3e, 0xa6, 0x73, 0x35, 0xd5, 0x89, 0x00, 0x79, 0xd7, 0xbf, 0x82, 0x9a, 0x0f, 0x2e, 0xc5,
|
||||
0x8b, 0xa2, 0x94, 0x1b, 0x89, 0x6a, 0xc2, 0xf2, 0x44, 0x4f, 0xba, 0x97, 0xc9, 0x1d, 0x1f, 0x41,
|
||||
0xad, 0x28, 0x63, 0x49, 0x86, 0x21, 0x98, 0x48, 0xd0, 0x0f, 0x61, 0xd3, 0xe2, 0x11, 0x31, 0xcf,
|
||||
0xf1, 0xed, 0x03, 0x3f, 0x4c, 0xf8, 0x2e, 0x73, 0xdd, 0x7c, 0x89, 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, 0x9a, 0x8b, 0x40, 0xdc, 0x87, 0x95,
|
||||
0xbe, 0xcf, 0xa2, 0x34, 0x6d, 0x6b, 0x96, 0x31, 0xf3, 0xf9, 0x6a, 0x3e, 0x5c, 0x1c, 0xcc, 0x06,
|
||||
0xe0, 0xc2, 0xda, 0x82, 0xf9, 0xa0, 0x31, 0x97, 0x74, 0xad, 0xcf, 0x9a, 0x4f, 0x6f, 0xc0, 0x4c,
|
||||
0xdf, 0x7a, 0xa1, 0xa0, 0x03, 0x78, 0xf5, 0x4f, 0x85, 0x4f, 0xae, 0x29, 0x31, 0xff, 0x27, 0x6e,
|
||||
0x1a, 0xbf, 0x26, 0xa6, 0x4f, 0x19, 0xe2, 0x29, 0x75, 0x3f, 0x71, 0xdd, 0xbd, 0x24, 0x74, 0xe9,
|
||||
0xcb, 0x3f, 0xd3, 0x64, 0x28, 0x52, 0x95, 0xfa, 0x81, 0xb9, 0x67, 0xff, 0xe1, 0xa9, 0x4e, 0x1f,
|
||||
0x1e, 0xf4, 0x7d, 0xb9, 0x41, 0x8f, 0x7c, 0x4e, 0xa3, 0xdc, 0x45, 0x6f, 0xe0, 0xfe, 0x0c, 0x7e,
|
||||
0x3b, 0x37, 0xfd, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x15, 0x62, 0x93, 0xba, 0xaf, 0x07, 0x00, 0x00,
|
||||
// 664 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xdd, 0x6e, 0xd3, 0x4c,
|
||||
0x10, 0xfd, 0x9c, 0x26, 0x4d, 0x3b, 0x49, 0xfd, 0x85, 0x2d, 0x55, 0xdd, 0x14, 0x89, 0xc8, 0x5c,
|
||||
0x60, 0x90, 0x48, 0x51, 0x10, 0x5c, 0x20, 0x01, 0x2a, 0x6d, 0x2a, 0x2a, 0xb5, 0x4d, 0xb1, 0x9b,
|
||||
0xeb, 0x68, 0x9b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c, 0x72,
|
||||
0x07, 0x66, 0x72, 0xd7, 0x73, 0x85, 0x38, 0x40, 0x6e, 0xbe, 0x54, 0xe4, 0xf1, 0x2d, 0x25, 0xe6,
|
||||
0x5f, 0xe2, 0xa6, 0xf1, 0x73, 0x62, 0x72, 0x95, 0x21, 0xae, 0x52, 0x0f, 0x62, 0xd7, 0xdd, 0x8f,
|
||||
0x43, 0x17, 0x3f, 0xff, 0x35, 0x4d, 0x86, 0x22, 0x55, 0xa9, 0x1f, 0xa8, 0x7b, 0xf1, 0x0f, 0xae,
|
||||
0xea, 0xf4, 0xe1, 0x7e, 0xdf, 0x97, 0x1b, 0xf4, 0xd0, 0xe7, 0x38, 0xca, 0x5c, 0xf4, 0x06, 0xee,
|
||||
0xcd, 0xe0, 0x8b, 0xb9, 0xe9, 0x7c, 0x59, 0xfe, 0x39, 0xbf, 0xf8, 0x11, 0x00, 0x00, 0xff, 0xff,
|
||||
0x87, 0xd4, 0xf3, 0x98, 0xb7, 0x07, 0x00, 0x00,
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
// An integration test service that covers all the method signature permutations
|
||||
// of unary/streaming requests/responses.
|
||||
syntax = "proto2";
|
||||
syntax = "proto3";
|
||||
|
||||
package grpc.testing;
|
||||
|
||||
|
@ -35,58 +35,58 @@ enum PayloadType {
|
|||
// A block of data, to simply increase gRPC message size.
|
||||
message Payload {
|
||||
// The type of data in body.
|
||||
optional PayloadType type = 1;
|
||||
PayloadType type = 1;
|
||||
// Primary contents of payload.
|
||||
optional bytes body = 2;
|
||||
bytes body = 2;
|
||||
}
|
||||
|
||||
// A protobuf representation for grpc status. This is used by test
|
||||
// clients to specify a status that the server should attempt to return.
|
||||
message EchoStatus {
|
||||
optional int32 code = 1;
|
||||
optional string message = 2;
|
||||
int32 code = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
// Unary request.
|
||||
message SimpleRequest {
|
||||
// Desired payload type in the response from the server.
|
||||
// If response_type is RANDOM, server randomly chooses one from other formats.
|
||||
optional PayloadType response_type = 1;
|
||||
PayloadType response_type = 1;
|
||||
|
||||
// Desired payload size in the response from the server.
|
||||
// If response_type is COMPRESSABLE, this denotes the size before compression.
|
||||
optional int32 response_size = 2;
|
||||
int32 response_size = 2;
|
||||
|
||||
// Optional input payload sent along with the request.
|
||||
optional Payload payload = 3;
|
||||
Payload payload = 3;
|
||||
|
||||
// Whether SimpleResponse should include username.
|
||||
optional bool fill_username = 4;
|
||||
bool fill_username = 4;
|
||||
|
||||
// Whether SimpleResponse should include OAuth scope.
|
||||
optional bool fill_oauth_scope = 5;
|
||||
bool fill_oauth_scope = 5;
|
||||
|
||||
// Whether server should return a given status
|
||||
optional EchoStatus response_status = 7;
|
||||
EchoStatus response_status = 7;
|
||||
}
|
||||
|
||||
// Unary response, as configured by the request.
|
||||
message SimpleResponse {
|
||||
// Payload to increase message size.
|
||||
optional Payload payload = 1;
|
||||
Payload payload = 1;
|
||||
|
||||
// The user the request came from, for verifying authentication was
|
||||
// successful when the client expected it.
|
||||
optional string username = 2;
|
||||
string username = 2;
|
||||
|
||||
// OAuth scope.
|
||||
optional string oauth_scope = 3;
|
||||
string oauth_scope = 3;
|
||||
}
|
||||
|
||||
// Client-streaming request.
|
||||
message StreamingInputCallRequest {
|
||||
// Optional input payload sent along with the request.
|
||||
optional Payload payload = 1;
|
||||
Payload payload = 1;
|
||||
|
||||
// Not expecting any payload from the response.
|
||||
}
|
||||
|
@ -94,18 +94,18 @@ message StreamingInputCallRequest {
|
|||
// Client-streaming response.
|
||||
message StreamingInputCallResponse {
|
||||
// Aggregated size of payloads received from the client.
|
||||
optional int32 aggregated_payload_size = 1;
|
||||
int32 aggregated_payload_size = 1;
|
||||
}
|
||||
|
||||
// Configuration for a particular response.
|
||||
message ResponseParameters {
|
||||
// Desired payload sizes in responses from the server.
|
||||
// If response_type is COMPRESSABLE, this denotes the size before compression.
|
||||
optional int32 size = 1;
|
||||
int32 size = 1;
|
||||
|
||||
// Desired interval between consecutive responses in the response stream in
|
||||
// microseconds.
|
||||
optional int32 interval_us = 2;
|
||||
int32 interval_us = 2;
|
||||
}
|
||||
|
||||
// Server-streaming request.
|
||||
|
@ -114,22 +114,22 @@ message StreamingOutputCallRequest {
|
|||
// If response_type is RANDOM, the payload from each response in the stream
|
||||
// might be of different types. This is to simulate a mixed type of payload
|
||||
// stream.
|
||||
optional PayloadType response_type = 1;
|
||||
PayloadType response_type = 1;
|
||||
|
||||
// Configuration for each expected response message.
|
||||
repeated ResponseParameters response_parameters = 2;
|
||||
|
||||
// Optional input payload sent along with the request.
|
||||
optional Payload payload = 3;
|
||||
Payload payload = 3;
|
||||
|
||||
// Whether server should return a given status
|
||||
optional EchoStatus response_status = 7;
|
||||
EchoStatus response_status = 7;
|
||||
}
|
||||
|
||||
// Server-streaming response, as configured by the request and parameters.
|
||||
message StreamingOutputCallResponse {
|
||||
// Payload to increase response size.
|
||||
optional Payload payload = 1;
|
||||
Payload payload = 1;
|
||||
}
|
||||
|
||||
// A simple service to test the various types of RPCs and experiment with
|
||||
|
|
|
@ -30,7 +30,6 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"golang.org/x/net/context"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
|
@ -57,8 +56,8 @@ var (
|
|||
func largeSimpleRequest() *testpb.SimpleRequest {
|
||||
pl := interop.ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize)
|
||||
return &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(int32(largeRespSize)),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: int32(largeRespSize),
|
||||
Payload: pl,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ func ClientNewPayload(t testpb.PayloadType, size int) *testpb.Payload {
|
|||
grpclog.Fatalf("Unsupported payload type: %d", t)
|
||||
}
|
||||
return &testpb.Payload{
|
||||
Type: t.Enum(),
|
||||
Type: t,
|
||||
Body: body,
|
||||
}
|
||||
}
|
||||
|
@ -81,8 +81,8 @@ func DoEmptyUnaryCall(tc testpb.TestServiceClient, args ...grpc.CallOption) {
|
|||
func DoLargeUnaryCall(tc testpb.TestServiceClient, args ...grpc.CallOption) {
|
||||
pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize)
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(int32(largeRespSize)),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: int32(largeRespSize),
|
||||
Payload: pl,
|
||||
}
|
||||
reply, err := tc.UnaryCall(context.Background(), req, args...)
|
||||
|
@ -127,11 +127,11 @@ func DoServerStreaming(tc testpb.TestServiceClient, args ...grpc.CallOption) {
|
|||
respParam := make([]*testpb.ResponseParameters, len(respSizes))
|
||||
for i, s := range respSizes {
|
||||
respParam[i] = &testpb.ResponseParameters{
|
||||
Size: proto.Int32(int32(s)),
|
||||
Size: int32(s),
|
||||
}
|
||||
}
|
||||
req := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
}
|
||||
stream, err := tc.StreamingOutputCall(context.Background(), req, args...)
|
||||
|
@ -176,12 +176,12 @@ func DoPingPong(tc testpb.TestServiceClient, args ...grpc.CallOption) {
|
|||
for index < len(reqSizes) {
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(int32(respSizes[index])),
|
||||
Size: int32(respSizes[index]),
|
||||
},
|
||||
}
|
||||
pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, reqSizes[index])
|
||||
req := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: pl,
|
||||
}
|
||||
|
@ -237,7 +237,7 @@ func DoTimeoutOnSleepingServer(tc testpb.TestServiceClient, args ...grpc.CallOpt
|
|||
}
|
||||
pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, 27182)
|
||||
req := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
Payload: pl,
|
||||
}
|
||||
if err := stream.Send(req); err != nil {
|
||||
|
@ -254,11 +254,11 @@ func DoTimeoutOnSleepingServer(tc testpb.TestServiceClient, args ...grpc.CallOpt
|
|||
func DoComputeEngineCreds(tc testpb.TestServiceClient, serviceAccount, oauthScope string) {
|
||||
pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize)
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(int32(largeRespSize)),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: int32(largeRespSize),
|
||||
Payload: pl,
|
||||
FillUsername: proto.Bool(true),
|
||||
FillOauthScope: proto.Bool(true),
|
||||
FillUsername: true,
|
||||
FillOauthScope: true,
|
||||
}
|
||||
reply, err := tc.UnaryCall(context.Background(), req)
|
||||
if err != nil {
|
||||
|
@ -286,11 +286,11 @@ func getServiceAccountJSONKey(keyFile string) []byte {
|
|||
func DoServiceAccountCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, oauthScope string) {
|
||||
pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize)
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(int32(largeRespSize)),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: int32(largeRespSize),
|
||||
Payload: pl,
|
||||
FillUsername: proto.Bool(true),
|
||||
FillOauthScope: proto.Bool(true),
|
||||
FillUsername: true,
|
||||
FillOauthScope: true,
|
||||
}
|
||||
reply, err := tc.UnaryCall(context.Background(), req)
|
||||
if err != nil {
|
||||
|
@ -311,10 +311,10 @@ func DoServiceAccountCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, o
|
|||
func DoJWTTokenCreds(tc testpb.TestServiceClient, serviceAccountKeyFile string) {
|
||||
pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize)
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(int32(largeRespSize)),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: int32(largeRespSize),
|
||||
Payload: pl,
|
||||
FillUsername: proto.Bool(true),
|
||||
FillUsername: true,
|
||||
}
|
||||
reply, err := tc.UnaryCall(context.Background(), req)
|
||||
if err != nil {
|
||||
|
@ -345,11 +345,11 @@ func GetToken(serviceAccountKeyFile string, oauthScope string) *oauth2.Token {
|
|||
func DoOauth2TokenCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, oauthScope string) {
|
||||
pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize)
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(int32(largeRespSize)),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: int32(largeRespSize),
|
||||
Payload: pl,
|
||||
FillUsername: proto.Bool(true),
|
||||
FillOauthScope: proto.Bool(true),
|
||||
FillUsername: true,
|
||||
FillOauthScope: true,
|
||||
}
|
||||
reply, err := tc.UnaryCall(context.Background(), req)
|
||||
if err != nil {
|
||||
|
@ -371,11 +371,11 @@ func DoPerRPCCreds(tc testpb.TestServiceClient, serviceAccountKeyFile, oauthScop
|
|||
jsonKey := getServiceAccountJSONKey(serviceAccountKeyFile)
|
||||
pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, largeReqSize)
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(int32(largeRespSize)),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: int32(largeRespSize),
|
||||
Payload: pl,
|
||||
FillUsername: proto.Bool(true),
|
||||
FillOauthScope: proto.Bool(true),
|
||||
FillUsername: true,
|
||||
FillOauthScope: true,
|
||||
}
|
||||
token := GetToken(serviceAccountKeyFile, oauthScope)
|
||||
kv := map[string]string{"authorization": token.Type() + " " + token.AccessToken}
|
||||
|
@ -424,12 +424,12 @@ func DoCancelAfterFirstResponse(tc testpb.TestServiceClient, args ...grpc.CallOp
|
|||
}
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(31415),
|
||||
Size: 31415,
|
||||
},
|
||||
}
|
||||
pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, 27182)
|
||||
req := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: pl,
|
||||
}
|
||||
|
@ -474,8 +474,8 @@ func DoCustomMetadata(tc testpb.TestServiceClient, args ...grpc.CallOption) {
|
|||
// Testing with UnaryCall.
|
||||
pl := ClientNewPayload(testpb.PayloadType_COMPRESSABLE, 1)
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(int32(1)),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: int32(1),
|
||||
Payload: pl,
|
||||
}
|
||||
ctx := metadata.NewOutgoingContext(context.Background(), customMetadata)
|
||||
|
@ -503,11 +503,11 @@ func DoCustomMetadata(tc testpb.TestServiceClient, args ...grpc.CallOption) {
|
|||
}
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(1),
|
||||
Size: 1,
|
||||
},
|
||||
}
|
||||
streamReq := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: pl,
|
||||
}
|
||||
|
@ -537,8 +537,8 @@ func DoStatusCodeAndMessage(tc testpb.TestServiceClient, args ...grpc.CallOption
|
|||
msg := "test status message"
|
||||
expectedErr := grpc.Errorf(codes.Code(code), msg)
|
||||
respStatus := &testpb.EchoStatus{
|
||||
Code: proto.Int32(code),
|
||||
Message: proto.String(msg),
|
||||
Code: code,
|
||||
Message: msg,
|
||||
}
|
||||
// Test UnaryCall.
|
||||
req := &testpb.SimpleRequest{
|
||||
|
@ -607,7 +607,7 @@ func serverNewPayload(t testpb.PayloadType, size int32) (*testpb.Payload, error)
|
|||
return nil, fmt.Errorf("unsupported payload type: %d", t)
|
||||
}
|
||||
return &testpb.Payload{
|
||||
Type: t.Enum(),
|
||||
Type: t,
|
||||
Body: body,
|
||||
}, nil
|
||||
}
|
||||
|
@ -624,8 +624,8 @@ func (s *testServer) UnaryCall(ctx context.Context, in *testpb.SimpleRequest) (*
|
|||
grpc.SetTrailer(ctx, trailer)
|
||||
}
|
||||
}
|
||||
if status != nil && *status.Code != 0 {
|
||||
return nil, grpc.Errorf(codes.Code(*status.Code), *status.Message)
|
||||
if status != nil && status.Code != 0 {
|
||||
return nil, grpc.Errorf(codes.Code(status.Code), status.Message)
|
||||
}
|
||||
pl, err := serverNewPayload(in.GetResponseType(), in.GetResponseSize())
|
||||
if err != nil {
|
||||
|
@ -661,7 +661,7 @@ func (s *testServer) StreamingInputCall(stream testpb.TestService_StreamingInput
|
|||
in, err := stream.Recv()
|
||||
if err == io.EOF {
|
||||
return stream.SendAndClose(&testpb.StreamingInputCallResponse{
|
||||
AggregatedPayloadSize: proto.Int32(int32(sum)),
|
||||
AggregatedPayloadSize: int32(sum),
|
||||
})
|
||||
}
|
||||
if err != nil {
|
||||
|
@ -693,8 +693,8 @@ func (s *testServer) FullDuplexCall(stream testpb.TestService_FullDuplexCallServ
|
|||
return err
|
||||
}
|
||||
status := in.GetResponseStatus()
|
||||
if status != nil && *status.Code != 0 {
|
||||
return grpc.Errorf(codes.Code(*status.Code), *status.Message)
|
||||
if status != nil && status.Code != 0 {
|
||||
return grpc.Errorf(codes.Code(status.Code), status.Message)
|
||||
}
|
||||
cs := in.GetResponseParameters()
|
||||
for _, c := range cs {
|
||||
|
|
|
@ -30,8 +30,7 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
|||
// Buffer is a message that contains a body of bytes that is used to exercise
|
||||
// encoding and decoding overheads.
|
||||
type Buffer struct {
|
||||
Body []byte `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
Body []byte `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Buffer) Reset() { *m = Buffer{} }
|
||||
|
@ -53,10 +52,11 @@ func init() {
|
|||
func init() { proto.RegisterFile("codec_perf/perf.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 78 bytes of a gzipped FileDescriptorProto
|
||||
// 83 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4d, 0xce, 0x4f, 0x49,
|
||||
0x4d, 0x8e, 0x2f, 0x48, 0x2d, 0x4a, 0xd3, 0x07, 0x11, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42,
|
||||
0x5c, 0x60, 0x61, 0x3d, 0x90, 0x88, 0x92, 0x0c, 0x17, 0x9b, 0x53, 0x69, 0x5a, 0x5a, 0x6a, 0x91,
|
||||
0x90, 0x10, 0x17, 0x4b, 0x52, 0x7e, 0x4a, 0xa5, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x4f, 0x10, 0x98,
|
||||
0x0d, 0x08, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x93, 0x4c, 0x5f, 0x41, 0x00, 0x00, 0x00,
|
||||
0x9d, 0xc4, 0x06, 0xd6, 0x60, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x5f, 0x4f, 0x3c, 0x49,
|
||||
0x00, 0x00, 0x00,
|
||||
}
|
||||
|
|
|
@ -14,12 +14,12 @@
|
|||
|
||||
// Messages used for performance tests that may not reference grpc directly for
|
||||
// reasons of import cycles.
|
||||
syntax = "proto2";
|
||||
syntax = "proto3";
|
||||
|
||||
package codec.perf;
|
||||
|
||||
// Buffer is a message that contains a body of bytes that is used to exercise
|
||||
// encoding and decoding overheads.
|
||||
message Buffer {
|
||||
optional bytes body = 1;
|
||||
bytes body = 1;
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ func newPayload(t testpb.PayloadType, size int32) (*testpb.Payload, error) {
|
|||
return nil, fmt.Errorf("Unsupported payload type: %d", t)
|
||||
}
|
||||
return &testpb.Payload{
|
||||
Type: t.Enum(),
|
||||
Type: t,
|
||||
Body: body,
|
||||
}, nil
|
||||
}
|
||||
|
@ -256,7 +256,7 @@ func (s *testServer) StreamingInputCall(stream testpb.TestService_StreamingInput
|
|||
in, err := stream.Recv()
|
||||
if err == io.EOF {
|
||||
return stream.SendAndClose(&testpb.StreamingInputCallResponse{
|
||||
AggregatedPayloadSize: proto.Int32(int32(sum)),
|
||||
AggregatedPayloadSize: int32(sum),
|
||||
})
|
||||
}
|
||||
if err != nil {
|
||||
|
@ -894,7 +894,7 @@ func testServerGoAwayPendingRPC(t *testing.T, e env) {
|
|||
}
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(1),
|
||||
Size: 1,
|
||||
},
|
||||
}
|
||||
payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, int32(100))
|
||||
|
@ -902,7 +902,7 @@ func testServerGoAwayPendingRPC(t *testing.T, e env) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
req := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: payload,
|
||||
}
|
||||
|
@ -978,7 +978,7 @@ func testServerMultipleGoAwayPendingRPC(t *testing.T, e env) {
|
|||
}
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(1),
|
||||
Size: 1,
|
||||
},
|
||||
}
|
||||
payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, int32(100))
|
||||
|
@ -986,7 +986,7 @@ func testServerMultipleGoAwayPendingRPC(t *testing.T, e env) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
req := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: payload,
|
||||
}
|
||||
|
@ -1093,7 +1093,7 @@ func testConcurrentServerStopAndGoAway(t *testing.T, e env) {
|
|||
te.srv.Stop()
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(1),
|
||||
Size: 1,
|
||||
},
|
||||
}
|
||||
payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, int32(100))
|
||||
|
@ -1101,7 +1101,7 @@ func testConcurrentServerStopAndGoAway(t *testing.T, e env) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
req := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: payload,
|
||||
}
|
||||
|
@ -1456,8 +1456,8 @@ func testServiceConfigMaxMsgSize(t *testing.T, e env) {
|
|||
tc := testpb.NewTestServiceClient(te1.clientConn())
|
||||
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(int32(extraLargeSize)),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: int32(extraLargeSize),
|
||||
Payload: smallPayload,
|
||||
}
|
||||
// Test for unary RPC recv.
|
||||
|
@ -1467,7 +1467,7 @@ func testServiceConfigMaxMsgSize(t *testing.T, e env) {
|
|||
|
||||
// Test for unary RPC send.
|
||||
req.Payload = extraLargePayload
|
||||
req.ResponseSize = proto.Int32(int32(smallSize))
|
||||
req.ResponseSize = int32(smallSize)
|
||||
if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted {
|
||||
t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted)
|
||||
}
|
||||
|
@ -1475,11 +1475,11 @@ func testServiceConfigMaxMsgSize(t *testing.T, e env) {
|
|||
// Test for streaming RPC recv.
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(int32(extraLargeSize)),
|
||||
Size: int32(extraLargeSize),
|
||||
},
|
||||
}
|
||||
sreq := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: smallPayload,
|
||||
}
|
||||
|
@ -1495,7 +1495,7 @@ func testServiceConfigMaxMsgSize(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
// Test for streaming RPC send.
|
||||
respParam[0].Size = proto.Int32(int32(smallSize))
|
||||
respParam[0].Size = int32(smallSize)
|
||||
sreq.Payload = extraLargePayload
|
||||
stream, err = tc.FullDuplexCall(te1.ctx)
|
||||
if err != nil {
|
||||
|
@ -1516,7 +1516,7 @@ func testServiceConfigMaxMsgSize(t *testing.T, e env) {
|
|||
|
||||
// Test for unary RPC recv.
|
||||
req.Payload = smallPayload
|
||||
req.ResponseSize = proto.Int32(int32(largeSize))
|
||||
req.ResponseSize = int32(largeSize)
|
||||
|
||||
if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted {
|
||||
t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted)
|
||||
|
@ -1524,14 +1524,14 @@ func testServiceConfigMaxMsgSize(t *testing.T, e env) {
|
|||
|
||||
// Test for unary RPC send.
|
||||
req.Payload = largePayload
|
||||
req.ResponseSize = proto.Int32(int32(smallSize))
|
||||
req.ResponseSize = int32(smallSize)
|
||||
if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted {
|
||||
t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted)
|
||||
}
|
||||
|
||||
// Test for streaming RPC recv.
|
||||
stream, err = tc.FullDuplexCall(te2.ctx)
|
||||
respParam[0].Size = proto.Int32(int32(largeSize))
|
||||
respParam[0].Size = int32(largeSize)
|
||||
sreq.Payload = smallPayload
|
||||
if err != nil {
|
||||
t.Fatalf("%v.FullDuplexCall(_) = _, %v, want <nil>", tc, err)
|
||||
|
@ -1544,7 +1544,7 @@ func testServiceConfigMaxMsgSize(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
// Test for streaming RPC send.
|
||||
respParam[0].Size = proto.Int32(int32(smallSize))
|
||||
respParam[0].Size = int32(smallSize)
|
||||
sreq.Payload = largePayload
|
||||
stream, err = tc.FullDuplexCall(te2.ctx)
|
||||
if err != nil {
|
||||
|
@ -1565,20 +1565,20 @@ func testServiceConfigMaxMsgSize(t *testing.T, e env) {
|
|||
|
||||
// Test for unary RPC recv.
|
||||
req.Payload = smallPayload
|
||||
req.ResponseSize = proto.Int32(int32(largeSize))
|
||||
req.ResponseSize = int32(largeSize)
|
||||
|
||||
if _, err := tc.UnaryCall(context.Background(), req); err != nil {
|
||||
t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want <nil>", err)
|
||||
}
|
||||
|
||||
req.ResponseSize = proto.Int32(int32(extraLargeSize))
|
||||
req.ResponseSize = int32(extraLargeSize)
|
||||
if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted {
|
||||
t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted)
|
||||
}
|
||||
|
||||
// Test for unary RPC send.
|
||||
req.Payload = largePayload
|
||||
req.ResponseSize = proto.Int32(int32(smallSize))
|
||||
req.ResponseSize = int32(smallSize)
|
||||
if _, err := tc.UnaryCall(context.Background(), req); err != nil {
|
||||
t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want <nil>", err)
|
||||
}
|
||||
|
@ -1593,7 +1593,7 @@ func testServiceConfigMaxMsgSize(t *testing.T, e env) {
|
|||
if err != nil {
|
||||
t.Fatalf("%v.FullDuplexCall(_) = _, %v, want <nil>", tc, err)
|
||||
}
|
||||
respParam[0].Size = proto.Int32(int32(largeSize))
|
||||
respParam[0].Size = int32(largeSize)
|
||||
sreq.Payload = smallPayload
|
||||
|
||||
if err := stream.Send(sreq); err != nil {
|
||||
|
@ -1603,7 +1603,7 @@ func testServiceConfigMaxMsgSize(t *testing.T, e env) {
|
|||
t.Fatalf("%v.Recv() = _, %v, want <nil>", stream, err)
|
||||
}
|
||||
|
||||
respParam[0].Size = proto.Int32(int32(extraLargeSize))
|
||||
respParam[0].Size = int32(extraLargeSize)
|
||||
|
||||
if err := stream.Send(sreq); err != nil {
|
||||
t.Fatalf("%v.Send(%v) = %v, want <nil>", stream, sreq, err)
|
||||
|
@ -1613,7 +1613,7 @@ func testServiceConfigMaxMsgSize(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
// Test for streaming RPC send.
|
||||
respParam[0].Size = proto.Int32(int32(smallSize))
|
||||
respParam[0].Size = int32(smallSize)
|
||||
sreq.Payload = largePayload
|
||||
stream, err = tc.FullDuplexCall(te3.ctx)
|
||||
if err != nil {
|
||||
|
@ -1656,8 +1656,8 @@ func testMaxMsgSizeClientDefault(t *testing.T, e env) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(int32(largeSize)),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: int32(largeSize),
|
||||
Payload: smallPayload,
|
||||
}
|
||||
// Test for unary RPC recv.
|
||||
|
@ -1667,11 +1667,11 @@ func testMaxMsgSizeClientDefault(t *testing.T, e env) {
|
|||
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(int32(largeSize)),
|
||||
Size: int32(largeSize),
|
||||
},
|
||||
}
|
||||
sreq := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: smallPayload,
|
||||
}
|
||||
|
@ -1726,8 +1726,8 @@ func testMaxMsgSizeClientAPI(t *testing.T, e env) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(int32(largeSize)),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: int32(largeSize),
|
||||
Payload: smallPayload,
|
||||
}
|
||||
// Test for unary RPC recv.
|
||||
|
@ -1737,18 +1737,18 @@ func testMaxMsgSizeClientAPI(t *testing.T, e env) {
|
|||
|
||||
// Test for unary RPC send.
|
||||
req.Payload = largePayload
|
||||
req.ResponseSize = proto.Int32(int32(smallSize))
|
||||
req.ResponseSize = int32(smallSize)
|
||||
if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted {
|
||||
t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted)
|
||||
}
|
||||
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(int32(largeSize)),
|
||||
Size: int32(largeSize),
|
||||
},
|
||||
}
|
||||
sreq := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: smallPayload,
|
||||
}
|
||||
|
@ -1766,7 +1766,7 @@ func testMaxMsgSizeClientAPI(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
// Test for streaming RPC send.
|
||||
respParam[0].Size = proto.Int32(int32(smallSize))
|
||||
respParam[0].Size = int32(smallSize)
|
||||
sreq.Payload = largePayload
|
||||
stream, err = tc.FullDuplexCall(te.ctx)
|
||||
if err != nil {
|
||||
|
@ -1812,8 +1812,8 @@ func testMaxMsgSizeServerAPI(t *testing.T, e env) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(int32(largeSize)),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: int32(largeSize),
|
||||
Payload: smallPayload,
|
||||
}
|
||||
// Test for unary RPC send.
|
||||
|
@ -1823,18 +1823,18 @@ func testMaxMsgSizeServerAPI(t *testing.T, e env) {
|
|||
|
||||
// Test for unary RPC recv.
|
||||
req.Payload = largePayload
|
||||
req.ResponseSize = proto.Int32(int32(smallSize))
|
||||
req.ResponseSize = int32(smallSize)
|
||||
if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted {
|
||||
t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted)
|
||||
}
|
||||
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(int32(largeSize)),
|
||||
Size: int32(largeSize),
|
||||
},
|
||||
}
|
||||
sreq := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: smallPayload,
|
||||
}
|
||||
|
@ -1852,7 +1852,7 @@ func testMaxMsgSizeServerAPI(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
// Test for streaming RPC recv.
|
||||
respParam[0].Size = proto.Int32(int32(smallSize))
|
||||
respParam[0].Size = int32(smallSize)
|
||||
sreq.Payload = largePayload
|
||||
stream, err = tc.FullDuplexCall(te.ctx)
|
||||
if err != nil {
|
||||
|
@ -1919,8 +1919,8 @@ func testTap(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(45),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: 45,
|
||||
Payload: payload,
|
||||
}
|
||||
if _, err := tc.UnaryCall(context.Background(), req); grpc.Code(err) != codes.Unavailable {
|
||||
|
@ -2173,8 +2173,8 @@ func testLargeUnary(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(respSize),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: respSize,
|
||||
Payload: payload,
|
||||
}
|
||||
reply, err := tc.UnaryCall(context.Background(), req)
|
||||
|
@ -2217,15 +2217,15 @@ func testExceedMsgLimit(t *testing.T, e env) {
|
|||
|
||||
// Test on server side for unary RPC.
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(smallSize),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: smallSize,
|
||||
Payload: payload,
|
||||
}
|
||||
if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted {
|
||||
t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted)
|
||||
}
|
||||
// Test on client side for unary RPC.
|
||||
req.ResponseSize = proto.Int32(int32(*te.maxMsgSize) + 1)
|
||||
req.ResponseSize = int32(*te.maxMsgSize) + 1
|
||||
req.Payload = smallPayload
|
||||
if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.ResourceExhausted {
|
||||
t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code: %s", err, codes.ResourceExhausted)
|
||||
|
@ -2238,7 +2238,7 @@ func testExceedMsgLimit(t *testing.T, e env) {
|
|||
}
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(1),
|
||||
Size: 1,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -2248,7 +2248,7 @@ func testExceedMsgLimit(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
sreq := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: spayload,
|
||||
}
|
||||
|
@ -2264,7 +2264,7 @@ func testExceedMsgLimit(t *testing.T, e env) {
|
|||
if err != nil {
|
||||
t.Fatalf("%v.FullDuplexCall(_) = _, %v, want <nil>", tc, err)
|
||||
}
|
||||
respParam[0].Size = proto.Int32(int32(*te.maxMsgSize) + 1)
|
||||
respParam[0].Size = int32(*te.maxMsgSize) + 1
|
||||
sreq.Payload = smallPayload
|
||||
if err := stream.Send(sreq); err != nil {
|
||||
t.Fatalf("%v.Send(%v) = %v, want <nil>", stream, sreq, err)
|
||||
|
@ -2362,7 +2362,7 @@ func testPeerFailedRPC(t *testing.T, e env) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
Payload: largePayload,
|
||||
}
|
||||
|
||||
|
@ -2413,8 +2413,8 @@ func testMetadataUnaryRPC(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(respSize),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: respSize,
|
||||
Payload: payload,
|
||||
}
|
||||
var header, trailer metadata.MD
|
||||
|
@ -2459,8 +2459,8 @@ func testMultipleSetTrailerUnaryRPC(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(respSize),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: respSize,
|
||||
Payload: payload,
|
||||
}
|
||||
var trailer metadata.MD
|
||||
|
@ -2533,8 +2533,8 @@ func testSetAndSendHeaderUnaryRPC(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(respSize),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: respSize,
|
||||
Payload: payload,
|
||||
}
|
||||
var header metadata.MD
|
||||
|
@ -2576,8 +2576,8 @@ func testMultipleSetHeaderUnaryRPC(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(respSize),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: respSize,
|
||||
Payload: payload,
|
||||
}
|
||||
|
||||
|
@ -2620,8 +2620,8 @@ func testMultipleSetHeaderUnaryRPCError(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(respSize),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: respSize,
|
||||
Payload: payload,
|
||||
}
|
||||
var header metadata.MD
|
||||
|
@ -2713,9 +2713,9 @@ func testMultipleSetHeaderStreamingRPC(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
req := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: []*testpb.ResponseParameters{
|
||||
{Size: proto.Int32(respSize)},
|
||||
{Size: respSize},
|
||||
},
|
||||
Payload: payload,
|
||||
}
|
||||
|
@ -2777,9 +2777,9 @@ func testMultipleSetHeaderStreamingRPCError(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
req := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: []*testpb.ResponseParameters{
|
||||
{Size: proto.Int32(respSize)},
|
||||
{Size: respSize},
|
||||
},
|
||||
Payload: payload,
|
||||
}
|
||||
|
@ -2831,8 +2831,8 @@ func testMalformedHTTP2Metadata(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(314),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: 314,
|
||||
Payload: payload,
|
||||
}
|
||||
ctx := metadata.NewOutgoingContext(context.Background(), malformedHTTP2Metadata)
|
||||
|
@ -2853,8 +2853,8 @@ func performOneRPC(t *testing.T, tc testpb.TestServiceClient, wg *sync.WaitGroup
|
|||
}
|
||||
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(respSize),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: respSize,
|
||||
Payload: payload,
|
||||
}
|
||||
reply, err := tc.UnaryCall(context.Background(), req, grpc.FailFast(false))
|
||||
|
@ -2951,8 +2951,8 @@ func testRPCTimeout(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(respSize),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: respSize,
|
||||
Payload: payload,
|
||||
}
|
||||
for i := -1; i <= 10; i++ {
|
||||
|
@ -2989,8 +2989,8 @@ func testCancel(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(respSize),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: respSize,
|
||||
Payload: payload,
|
||||
}
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
|
@ -3115,7 +3115,7 @@ func testPingPong(t *testing.T, e env) {
|
|||
for index < len(reqSizes) {
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(int32(respSizes[index])),
|
||||
Size: int32(respSizes[index]),
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -3125,7 +3125,7 @@ func testPingPong(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
req := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: payload,
|
||||
}
|
||||
|
@ -3193,7 +3193,7 @@ func testMetadataStreamingRPC(t *testing.T, e env) {
|
|||
for index := 0; index < len(reqSizes); index++ {
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(int32(respSizes[index])),
|
||||
Size: int32(respSizes[index]),
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -3203,7 +3203,7 @@ func testMetadataStreamingRPC(t *testing.T, e env) {
|
|||
}
|
||||
|
||||
req := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: payload,
|
||||
}
|
||||
|
@ -3246,11 +3246,11 @@ func testServerStreaming(t *testing.T, e env) {
|
|||
respParam := make([]*testpb.ResponseParameters, len(respSizes))
|
||||
for i, s := range respSizes {
|
||||
respParam[i] = &testpb.ResponseParameters{
|
||||
Size: proto.Int32(int32(s)),
|
||||
Size: int32(s),
|
||||
}
|
||||
}
|
||||
req := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
}
|
||||
stream, err := tc.StreamingOutputCall(context.Background(), req)
|
||||
|
@ -3302,11 +3302,11 @@ func testFailedServerStreaming(t *testing.T, e env) {
|
|||
respParam := make([]*testpb.ResponseParameters, len(respSizes))
|
||||
for i, s := range respSizes {
|
||||
respParam[i] = &testpb.ResponseParameters{
|
||||
Size: proto.Int32(int32(s)),
|
||||
Size: int32(s),
|
||||
}
|
||||
}
|
||||
req := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
}
|
||||
ctx := metadata.NewOutgoingContext(te.ctx, testMetadata)
|
||||
|
@ -3647,8 +3647,8 @@ func testStreamsQuotaRecovery(t *testing.T, e env) {
|
|||
return
|
||||
}
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(1592),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: 1592,
|
||||
Payload: payload,
|
||||
}
|
||||
// No rpc should go through due to the max streams limit.
|
||||
|
@ -3684,8 +3684,8 @@ func testCompressServerHasNoSupport(t *testing.T, e env) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(respSize),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: respSize,
|
||||
Payload: payload,
|
||||
}
|
||||
if _, err := tc.UnaryCall(context.Background(), req); err == nil || grpc.Code(err) != codes.Unimplemented {
|
||||
|
@ -3698,7 +3698,7 @@ func testCompressServerHasNoSupport(t *testing.T, e env) {
|
|||
}
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(31415),
|
||||
Size: 31415,
|
||||
},
|
||||
}
|
||||
payload, err = newPayload(testpb.PayloadType_COMPRESSABLE, int32(31415))
|
||||
|
@ -3706,7 +3706,7 @@ func testCompressServerHasNoSupport(t *testing.T, e env) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
sreq := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: payload,
|
||||
}
|
||||
|
@ -3741,8 +3741,8 @@ func testCompressOK(t *testing.T, e env) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
req := &testpb.SimpleRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseSize: proto.Int32(respSize),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseSize: respSize,
|
||||
Payload: payload,
|
||||
}
|
||||
ctx := metadata.NewOutgoingContext(context.Background(), metadata.Pairs("something", "something"))
|
||||
|
@ -3758,7 +3758,7 @@ func testCompressOK(t *testing.T, e env) {
|
|||
}
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(31415),
|
||||
Size: 31415,
|
||||
},
|
||||
}
|
||||
payload, err = newPayload(testpb.PayloadType_COMPRESSABLE, int32(31415))
|
||||
|
@ -3766,7 +3766,7 @@ func testCompressOK(t *testing.T, e env) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
sreq := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: payload,
|
||||
}
|
||||
|
@ -3830,7 +3830,7 @@ func testStreamClientInterceptor(t *testing.T, e env) {
|
|||
tc := testpb.NewTestServiceClient(te.clientConn())
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(int32(1)),
|
||||
Size: int32(1),
|
||||
},
|
||||
}
|
||||
payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, int32(1))
|
||||
|
@ -3838,7 +3838,7 @@ func testStreamClientInterceptor(t *testing.T, e env) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
req := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: payload,
|
||||
}
|
||||
|
@ -3898,7 +3898,7 @@ func testStreamServerInterceptor(t *testing.T, e env) {
|
|||
tc := testpb.NewTestServiceClient(te.clientConn())
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(int32(1)),
|
||||
Size: int32(1),
|
||||
},
|
||||
}
|
||||
payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, int32(1))
|
||||
|
@ -3906,7 +3906,7 @@ func testStreamServerInterceptor(t *testing.T, e env) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
req := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: payload,
|
||||
}
|
||||
|
@ -4753,11 +4753,11 @@ func testConfigurableWindowSize(t *testing.T, e env, wc windowSizeConfig) {
|
|||
}
|
||||
respParams := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(messageSize),
|
||||
Size: messageSize,
|
||||
},
|
||||
}
|
||||
req := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParams,
|
||||
Payload: payload,
|
||||
}
|
||||
|
@ -4994,11 +4994,11 @@ func testSvrWriteStatusEarlyWrite(t *testing.T, e env) {
|
|||
tc := testpb.NewTestServiceClient(te.clientConn())
|
||||
respParam := []*testpb.ResponseParameters{
|
||||
{
|
||||
Size: proto.Int32(int32(smallSize)),
|
||||
Size: int32(smallSize),
|
||||
},
|
||||
}
|
||||
sreq := &testpb.StreamingOutputCallRequest{
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE.Enum(),
|
||||
ResponseType: testpb.PayloadType_COMPRESSABLE,
|
||||
ResponseParameters: respParam,
|
||||
Payload: extraLargePayload,
|
||||
}
|
||||
|
@ -5015,7 +5015,7 @@ func testSvrWriteStatusEarlyWrite(t *testing.T, e env) {
|
|||
}
|
||||
// Test send case: server sends a message larger than maxServerSendMsgSize.
|
||||
sreq.Payload = smallPayload
|
||||
respParam[0].Size = proto.Int32(int32(extraLargeSize))
|
||||
respParam[0].Size = int32(extraLargeSize)
|
||||
|
||||
stream, err = tc.FullDuplexCall(te.ctx)
|
||||
if err != nil {
|
||||
|
|
|
@ -63,26 +63,12 @@ var PayloadType_value = map[string]int32{
|
|||
"RANDOM": 2,
|
||||
}
|
||||
|
||||
func (x PayloadType) Enum() *PayloadType {
|
||||
p := new(PayloadType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x PayloadType) String() string {
|
||||
return proto.EnumName(PayloadType_name, int32(x))
|
||||
}
|
||||
func (x *PayloadType) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(PayloadType_value, data, "PayloadType")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = PayloadType(value)
|
||||
return nil
|
||||
}
|
||||
func (PayloadType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
||||
|
||||
type Empty struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Empty) Reset() { *m = Empty{} }
|
||||
|
@ -93,10 +79,9 @@ func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
|||
// A block of data, to simply increase gRPC message size.
|
||||
type Payload struct {
|
||||
// The type of data in body.
|
||||
Type *PayloadType `protobuf:"varint,1,opt,name=type,enum=grpc.testing.PayloadType" json:"type,omitempty"`
|
||||
Type PayloadType `protobuf:"varint,1,opt,name=type,enum=grpc.testing.PayloadType" json:"type,omitempty"`
|
||||
// Primary contents of payload.
|
||||
Body []byte `protobuf:"bytes,2,opt,name=body" json:"body,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Payload) Reset() { *m = Payload{} }
|
||||
|
@ -105,8 +90,8 @@ func (*Payload) ProtoMessage() {}
|
|||
func (*Payload) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
||||
|
||||
func (m *Payload) GetType() PayloadType {
|
||||
if m != nil && m.Type != nil {
|
||||
return *m.Type
|
||||
if m != nil {
|
||||
return m.Type
|
||||
}
|
||||
return PayloadType_COMPRESSABLE
|
||||
}
|
||||
|
@ -122,17 +107,16 @@ func (m *Payload) GetBody() []byte {
|
|||
type SimpleRequest struct {
|
||||
// Desired payload type in the response from the server.
|
||||
// If response_type is RANDOM, server randomly chooses one from other formats.
|
||||
ResponseType *PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,enum=grpc.testing.PayloadType" json:"response_type,omitempty"`
|
||||
ResponseType PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,enum=grpc.testing.PayloadType" json:"response_type,omitempty"`
|
||||
// Desired payload size in the response from the server.
|
||||
// If response_type is COMPRESSABLE, this denotes the size before compression.
|
||||
ResponseSize *int32 `protobuf:"varint,2,opt,name=response_size,json=responseSize" json:"response_size,omitempty"`
|
||||
ResponseSize int32 `protobuf:"varint,2,opt,name=response_size,json=responseSize" json:"response_size,omitempty"`
|
||||
// Optional input payload sent along with the request.
|
||||
Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"`
|
||||
// Whether SimpleResponse should include username.
|
||||
FillUsername *bool `protobuf:"varint,4,opt,name=fill_username,json=fillUsername" json:"fill_username,omitempty"`
|
||||
FillUsername bool `protobuf:"varint,4,opt,name=fill_username,json=fillUsername" json:"fill_username,omitempty"`
|
||||
// Whether SimpleResponse should include OAuth scope.
|
||||
FillOauthScope *bool `protobuf:"varint,5,opt,name=fill_oauth_scope,json=fillOauthScope" json:"fill_oauth_scope,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
FillOauthScope bool `protobuf:"varint,5,opt,name=fill_oauth_scope,json=fillOauthScope" json:"fill_oauth_scope,omitempty"`
|
||||
}
|
||||
|
||||
func (m *SimpleRequest) Reset() { *m = SimpleRequest{} }
|
||||
|
@ -141,15 +125,15 @@ func (*SimpleRequest) ProtoMessage() {}
|
|||
func (*SimpleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
|
||||
|
||||
func (m *SimpleRequest) GetResponseType() PayloadType {
|
||||
if m != nil && m.ResponseType != nil {
|
||||
return *m.ResponseType
|
||||
if m != nil {
|
||||
return m.ResponseType
|
||||
}
|
||||
return PayloadType_COMPRESSABLE
|
||||
}
|
||||
|
||||
func (m *SimpleRequest) GetResponseSize() int32 {
|
||||
if m != nil && m.ResponseSize != nil {
|
||||
return *m.ResponseSize
|
||||
if m != nil {
|
||||
return m.ResponseSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
@ -162,15 +146,15 @@ func (m *SimpleRequest) GetPayload() *Payload {
|
|||
}
|
||||
|
||||
func (m *SimpleRequest) GetFillUsername() bool {
|
||||
if m != nil && m.FillUsername != nil {
|
||||
return *m.FillUsername
|
||||
if m != nil {
|
||||
return m.FillUsername
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *SimpleRequest) GetFillOauthScope() bool {
|
||||
if m != nil && m.FillOauthScope != nil {
|
||||
return *m.FillOauthScope
|
||||
if m != nil {
|
||||
return m.FillOauthScope
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
@ -181,10 +165,9 @@ type SimpleResponse struct {
|
|||
Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"`
|
||||
// The user the request came from, for verifying authentication was
|
||||
// successful when the client expected it.
|
||||
Username *string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"`
|
||||
Username string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"`
|
||||
// OAuth scope.
|
||||
OauthScope *string `protobuf:"bytes,3,opt,name=oauth_scope,json=oauthScope" json:"oauth_scope,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
OauthScope string `protobuf:"bytes,3,opt,name=oauth_scope,json=oauthScope" json:"oauth_scope,omitempty"`
|
||||
}
|
||||
|
||||
func (m *SimpleResponse) Reset() { *m = SimpleResponse{} }
|
||||
|
@ -200,15 +183,15 @@ func (m *SimpleResponse) GetPayload() *Payload {
|
|||
}
|
||||
|
||||
func (m *SimpleResponse) GetUsername() string {
|
||||
if m != nil && m.Username != nil {
|
||||
return *m.Username
|
||||
if m != nil {
|
||||
return m.Username
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *SimpleResponse) GetOauthScope() string {
|
||||
if m != nil && m.OauthScope != nil {
|
||||
return *m.OauthScope
|
||||
if m != nil {
|
||||
return m.OauthScope
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
@ -216,8 +199,7 @@ func (m *SimpleResponse) GetOauthScope() string {
|
|||
// Client-streaming request.
|
||||
type StreamingInputCallRequest struct {
|
||||
// Optional input payload sent along with the request.
|
||||
Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"`
|
||||
}
|
||||
|
||||
func (m *StreamingInputCallRequest) Reset() { *m = StreamingInputCallRequest{} }
|
||||
|
@ -235,8 +217,7 @@ func (m *StreamingInputCallRequest) GetPayload() *Payload {
|
|||
// Client-streaming response.
|
||||
type StreamingInputCallResponse struct {
|
||||
// Aggregated size of payloads received from the client.
|
||||
AggregatedPayloadSize *int32 `protobuf:"varint,1,opt,name=aggregated_payload_size,json=aggregatedPayloadSize" json:"aggregated_payload_size,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
AggregatedPayloadSize int32 `protobuf:"varint,1,opt,name=aggregated_payload_size,json=aggregatedPayloadSize" json:"aggregated_payload_size,omitempty"`
|
||||
}
|
||||
|
||||
func (m *StreamingInputCallResponse) Reset() { *m = StreamingInputCallResponse{} }
|
||||
|
@ -245,8 +226,8 @@ func (*StreamingInputCallResponse) ProtoMessage() {}
|
|||
func (*StreamingInputCallResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
|
||||
|
||||
func (m *StreamingInputCallResponse) GetAggregatedPayloadSize() int32 {
|
||||
if m != nil && m.AggregatedPayloadSize != nil {
|
||||
return *m.AggregatedPayloadSize
|
||||
if m != nil {
|
||||
return m.AggregatedPayloadSize
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
@ -255,11 +236,10 @@ func (m *StreamingInputCallResponse) GetAggregatedPayloadSize() int32 {
|
|||
type ResponseParameters struct {
|
||||
// Desired payload sizes in responses from the server.
|
||||
// If response_type is COMPRESSABLE, this denotes the size before compression.
|
||||
Size *int32 `protobuf:"varint,1,opt,name=size" json:"size,omitempty"`
|
||||
Size int32 `protobuf:"varint,1,opt,name=size" json:"size,omitempty"`
|
||||
// Desired interval between consecutive responses in the response stream in
|
||||
// microseconds.
|
||||
IntervalUs *int32 `protobuf:"varint,2,opt,name=interval_us,json=intervalUs" json:"interval_us,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
IntervalUs int32 `protobuf:"varint,2,opt,name=interval_us,json=intervalUs" json:"interval_us,omitempty"`
|
||||
}
|
||||
|
||||
func (m *ResponseParameters) Reset() { *m = ResponseParameters{} }
|
||||
|
@ -268,15 +248,15 @@ func (*ResponseParameters) ProtoMessage() {}
|
|||
func (*ResponseParameters) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
|
||||
|
||||
func (m *ResponseParameters) GetSize() int32 {
|
||||
if m != nil && m.Size != nil {
|
||||
return *m.Size
|
||||
if m != nil {
|
||||
return m.Size
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ResponseParameters) GetIntervalUs() int32 {
|
||||
if m != nil && m.IntervalUs != nil {
|
||||
return *m.IntervalUs
|
||||
if m != nil {
|
||||
return m.IntervalUs
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
@ -287,12 +267,11 @@ type StreamingOutputCallRequest struct {
|
|||
// If response_type is RANDOM, the payload from each response in the stream
|
||||
// might be of different types. This is to simulate a mixed type of payload
|
||||
// stream.
|
||||
ResponseType *PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,enum=grpc.testing.PayloadType" json:"response_type,omitempty"`
|
||||
ResponseType PayloadType `protobuf:"varint,1,opt,name=response_type,json=responseType,enum=grpc.testing.PayloadType" json:"response_type,omitempty"`
|
||||
// Configuration for each expected response message.
|
||||
ResponseParameters []*ResponseParameters `protobuf:"bytes,2,rep,name=response_parameters,json=responseParameters" json:"response_parameters,omitempty"`
|
||||
// Optional input payload sent along with the request.
|
||||
Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
Payload *Payload `protobuf:"bytes,3,opt,name=payload" json:"payload,omitempty"`
|
||||
}
|
||||
|
||||
func (m *StreamingOutputCallRequest) Reset() { *m = StreamingOutputCallRequest{} }
|
||||
|
@ -301,8 +280,8 @@ func (*StreamingOutputCallRequest) ProtoMessage() {}
|
|||
func (*StreamingOutputCallRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
|
||||
|
||||
func (m *StreamingOutputCallRequest) GetResponseType() PayloadType {
|
||||
if m != nil && m.ResponseType != nil {
|
||||
return *m.ResponseType
|
||||
if m != nil {
|
||||
return m.ResponseType
|
||||
}
|
||||
return PayloadType_COMPRESSABLE
|
||||
}
|
||||
|
@ -324,8 +303,7 @@ func (m *StreamingOutputCallRequest) GetPayload() *Payload {
|
|||
// Server-streaming response, as configured by the request and parameters.
|
||||
type StreamingOutputCallResponse struct {
|
||||
// Payload to increase response size.
|
||||
Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"`
|
||||
}
|
||||
|
||||
func (m *StreamingOutputCallResponse) Reset() { *m = StreamingOutputCallResponse{} }
|
||||
|
@ -747,42 +725,42 @@ var _TestService_serviceDesc = grpc.ServiceDesc{
|
|||
func init() { proto.RegisterFile("grpc_testing/test.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 582 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0xdd, 0x6e, 0xd3, 0x4c,
|
||||
0x10, 0xfd, 0xb6, 0x49, 0xbe, 0x34, 0x93, 0xd4, 0x8a, 0x36, 0xaa, 0xea, 0xba, 0x48, 0x58, 0xe6,
|
||||
0x02, 0x83, 0x44, 0x8a, 0x22, 0xc1, 0x25, 0xa8, 0xb4, 0xa9, 0xa8, 0x94, 0x26, 0xc1, 0x4e, 0xae,
|
||||
0xa3, 0x25, 0xd9, 0x1a, 0x4b, 0x8e, 0xbd, 0xac, 0xd7, 0x15, 0xe9, 0x05, 0x2f, 0xc6, 0xcb, 0xf0,
|
||||
0x10, 0x3c, 0x00, 0x5a, 0xff, 0x24, 0x4e, 0xe2, 0x8a, 0x14, 0x04, 0x57, 0xb6, 0x67, 0xce, 0x9c,
|
||||
0x39, 0xc7, 0x33, 0xbb, 0x70, 0xe4, 0x70, 0x36, 0x9d, 0x08, 0x1a, 0x0a, 0xd7, 0x77, 0x4e, 0xe5,
|
||||
0xb3, 0xcd, 0x78, 0x20, 0x02, 0xdc, 0x90, 0x89, 0x76, 0x9a, 0x30, 0xaa, 0x50, 0xe9, 0xce, 0x99,
|
||||
0x58, 0x18, 0x3d, 0xa8, 0x0e, 0xc9, 0xc2, 0x0b, 0xc8, 0x0c, 0xbf, 0x80, 0xb2, 0x58, 0x30, 0xaa,
|
||||
0x22, 0x1d, 0x99, 0x4a, 0xe7, 0xb8, 0x9d, 0x2f, 0x68, 0xa7, 0xa0, 0xd1, 0x82, 0x51, 0x2b, 0x86,
|
||||
0x61, 0x0c, 0xe5, 0x8f, 0xc1, 0x6c, 0xa1, 0xee, 0xe9, 0xc8, 0x6c, 0x58, 0xf1, 0xbb, 0xf1, 0x03,
|
||||
0xc1, 0x81, 0xed, 0xce, 0x99, 0x47, 0x2d, 0xfa, 0x39, 0xa2, 0xa1, 0xc0, 0x6f, 0xe0, 0x80, 0xd3,
|
||||
0x90, 0x05, 0x7e, 0x48, 0x27, 0xbb, 0xb1, 0x37, 0x32, 0xbc, 0xfc, 0xc2, 0x4f, 0x72, 0xf5, 0xa1,
|
||||
0x7b, 0x47, 0xe3, 0x76, 0x95, 0x15, 0xc8, 0x76, 0xef, 0x28, 0x3e, 0x85, 0x2a, 0x4b, 0x18, 0xd4,
|
||||
0x92, 0x8e, 0xcc, 0x7a, 0xe7, 0xb0, 0x90, 0xde, 0xca, 0x50, 0x92, 0xf5, 0xc6, 0xf5, 0xbc, 0x49,
|
||||
0x14, 0x52, 0xee, 0x93, 0x39, 0x55, 0xcb, 0x3a, 0x32, 0xf7, 0xad, 0x86, 0x0c, 0x8e, 0xd3, 0x18,
|
||||
0x36, 0xa1, 0x19, 0x83, 0x02, 0x12, 0x89, 0x4f, 0x93, 0x70, 0x1a, 0x30, 0xaa, 0x56, 0x62, 0x9c,
|
||||
0x22, 0xe3, 0x03, 0x19, 0xb6, 0x65, 0xd4, 0xf8, 0x0a, 0x4a, 0xe6, 0x3a, 0x51, 0x95, 0x57, 0x84,
|
||||
0x76, 0x52, 0xa4, 0xc1, 0xfe, 0x52, 0x8c, 0xb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xb3, 0xfe, 0xc5, 0xe0, 0xba, 0xb9, 0xd7, 0xf9, 0x56, 0x86,
|
||||
0xfa, 0x88, 0x86, 0xc2, 0xa6, 0xfc, 0xd6, 0x9d, 0x52, 0xfc, 0x0a, 0x6a, 0xf1, 0x05, 0x22, 0x65,
|
||||
0xe1, 0xd6, 0x7a, 0xf7, 0x38, 0xa1, 0x15, 0x05, 0xf1, 0x25, 0xd4, 0xc6, 0x3e, 0xe1, 0x49, 0xd9,
|
||||
0xc9, 0x3a, 0x62, 0xed, 0xe2, 0xd0, 0x1e, 0x15, 0x27, 0xd3, 0x1f, 0xe0, 0x41, 0xab, 0xe0, 0xff,
|
||||
0x60, 0x73, 0xa3, 0xe8, 0xde, 0x25, 0xd1, 0x9e, 0xed, 0x80, 0x4c, 0x7a, 0xbd, 0x44, 0xd8, 0x05,
|
||||
0xbc, 0x7d, 0x22, 0xf0, 0xd3, 0x7b, 0x28, 0x36, 0x4f, 0xa0, 0x66, 0xfe, 0x1a, 0x98, 0xb4, 0x32,
|
||||
0x65, 0x2b, 0xe5, 0x32, 0xf2, 0xbc, 0x8b, 0x88, 0x79, 0xf4, 0xcb, 0x5f, 0xf3, 0x64, 0xa2, 0xd8,
|
||||
0x95, 0xf2, 0x9e, 0x78, 0x37, 0xff, 0xa0, 0xd5, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb8, 0xa6,
|
||||
0x30, 0x01, 0x96, 0x06, 0x00, 0x00,
|
||||
// 587 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xdb, 0x6e, 0xd3, 0x40,
|
||||
0x10, 0x65, 0xdb, 0xf4, 0x36, 0x49, 0xad, 0x68, 0xab, 0xaa, 0xae, 0x8b, 0x84, 0x65, 0x1e, 0x30,
|
||||
0x48, 0xa4, 0x28, 0x08, 0x1e, 0x41, 0xa5, 0x17, 0x51, 0x29, 0x4d,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 0x92, 0xac, 0x37, 0x7e, 0x10, 0x0c, 0x92,
|
||||
0x98, 0xf2, 0x90, 0x8c, 0xa9, 0x5e, 0x31, 0x91, 0xbd, 0xed, 0xd4, 0x64, 0xb0, 0x9f, 0xc5, 0xb0,
|
||||
0x0d, 0x75, 0x05, 0x8a, 0x48, 0x22, 0x3e, 0x0f, 0xe2, 0x61, 0xc4, 0xa8, 0xbe, 0xa1, 0x70, 0x9a,
|
||||
0x8c, 0x77, 0x64, 0xd8, 0x95, 0x51, 0xeb, 0x1b, 0x68, 0xb9, 0xeb, 0x54, 0x55, 0x51, 0x11, 0x5a,
|
||||
0x49, 0x91, 0x01, 0xdb, 0x53, 0x31, 0xd2, 0xe2, 0x8e, 0x33, 0x7d, 0xc7, 0x4f, 0xa0, 0x5a, 0xd4,
|
||||
0xb0, 0xae, 0xd2, 0x10, 0xcd, 0xfa, 0xb7, 0xe0, 0xd0, 0x15, 0x9c, 0x92, 0xb1, 0x1f, 0x7a, 0x97,
|
||||
0x21, 0x4b, 0xc4, 0x29, 0x09, 0x82, 0x7c, 0x02, 0x0f, 0x95, 0x62, 0xf5, 0xc0, 0x28, 0x63, 0xcb,
|
||||
0x9c, 0xbd, 0x85, 0x03, 0xe2, 0x79, 0x9c, 0x7a, 0x44, 0xd0, 0xd1, 0x20, 0xab, 0x49, 0x47, 0x83,
|
||||
0xd4, 0x68, 0xf6, 0x67, 0xe9, 0x8c, 0x5a, 0xce, 0xc8, 0xba, 0x04, 0x9c, 0x73, 0x74, 0x09, 0x27,
|
||||
0x63, 0x2a, 0x28, 0x8f, 0xe5, 0x12, 0x15, 0x4a, 0xd5, 0xb3, 0xb4, 0xeb, 0x87, 0x82, 0xf2, 0x5b,
|
||||
0x22, 0x07, 0x94, 0x0d, 0x1c, 0xf2, 0x50, 0x3f, 0xb6, 0x7e, 0xa0, 0x82, 0xc2, 0x4e, 0x22, 0x16,
|
||||
0x0c, 0xff, 0xed, 0xca, 0x7d, 0x82, 0xbd, 0x69, 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f, 0xad, 0xae, 0x37, 0xd5, 0x7f, 0xd0, 0xeb, 0x5f, 0x01, 0x00,
|
||||
0x00, 0xff, 0xff, 0x07, 0xc7, 0x76, 0x69, 0x9e, 0x06, 0x00, 0x00,
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
// An integration test service that covers all the method signature permutations
|
||||
// of unary/streaming requests/responses.
|
||||
syntax = "proto2";
|
||||
syntax = "proto3";
|
||||
|
||||
package grpc.testing;
|
||||
|
||||
|
@ -35,48 +35,48 @@ enum PayloadType {
|
|||
// A block of data, to simply increase gRPC message size.
|
||||
message Payload {
|
||||
// The type of data in body.
|
||||
optional PayloadType type = 1;
|
||||
PayloadType type = 1;
|
||||
// Primary contents of payload.
|
||||
optional bytes body = 2;
|
||||
bytes body = 2;
|
||||
}
|
||||
|
||||
// Unary request.
|
||||
message SimpleRequest {
|
||||
// Desired payload type in the response from the server.
|
||||
// If response_type is RANDOM, server randomly chooses one from other formats.
|
||||
optional PayloadType response_type = 1;
|
||||
PayloadType response_type = 1;
|
||||
|
||||
// Desired payload size in the response from the server.
|
||||
// If response_type is COMPRESSABLE, this denotes the size before compression.
|
||||
optional int32 response_size = 2;
|
||||
int32 response_size = 2;
|
||||
|
||||
// Optional input payload sent along with the request.
|
||||
optional Payload payload = 3;
|
||||
Payload payload = 3;
|
||||
|
||||
// Whether SimpleResponse should include username.
|
||||
optional bool fill_username = 4;
|
||||
bool fill_username = 4;
|
||||
|
||||
// Whether SimpleResponse should include OAuth scope.
|
||||
optional bool fill_oauth_scope = 5;
|
||||
bool fill_oauth_scope = 5;
|
||||
}
|
||||
|
||||
// Unary response, as configured by the request.
|
||||
message SimpleResponse {
|
||||
// Payload to increase message size.
|
||||
optional Payload payload = 1;
|
||||
Payload payload = 1;
|
||||
|
||||
// The user the request came from, for verifying authentication was
|
||||
// successful when the client expected it.
|
||||
optional string username = 2;
|
||||
string username = 2;
|
||||
|
||||
// OAuth scope.
|
||||
optional string oauth_scope = 3;
|
||||
string oauth_scope = 3;
|
||||
}
|
||||
|
||||
// Client-streaming request.
|
||||
message StreamingInputCallRequest {
|
||||
// Optional input payload sent along with the request.
|
||||
optional Payload payload = 1;
|
||||
Payload payload = 1;
|
||||
|
||||
// Not expecting any payload from the response.
|
||||
}
|
||||
|
@ -84,18 +84,18 @@ message StreamingInputCallRequest {
|
|||
// Client-streaming response.
|
||||
message StreamingInputCallResponse {
|
||||
// Aggregated size of payloads received from the client.
|
||||
optional int32 aggregated_payload_size = 1;
|
||||
int32 aggregated_payload_size = 1;
|
||||
}
|
||||
|
||||
// Configuration for a particular response.
|
||||
message ResponseParameters {
|
||||
// Desired payload sizes in responses from the server.
|
||||
// If response_type is COMPRESSABLE, this denotes the size before compression.
|
||||
optional int32 size = 1;
|
||||
int32 size = 1;
|
||||
|
||||
// Desired interval between consecutive responses in the response stream in
|
||||
// microseconds.
|
||||
optional int32 interval_us = 2;
|
||||
int32 interval_us = 2;
|
||||
}
|
||||
|
||||
// Server-streaming request.
|
||||
|
@ -104,19 +104,19 @@ message StreamingOutputCallRequest {
|
|||
// If response_type is RANDOM, the payload from each response in the stream
|
||||
// might be of different types. This is to simulate a mixed type of payload
|
||||
// stream.
|
||||
optional PayloadType response_type = 1;
|
||||
PayloadType response_type = 1;
|
||||
|
||||
// Configuration for each expected response message.
|
||||
repeated ResponseParameters response_parameters = 2;
|
||||
|
||||
// Optional input payload sent along with the request.
|
||||
optional Payload payload = 3;
|
||||
Payload payload = 3;
|
||||
}
|
||||
|
||||
// Server-streaming response, as configured by the request and parameters.
|
||||
message StreamingOutputCallResponse {
|
||||
// Payload to increase response size.
|
||||
optional Payload payload = 1;
|
||||
Payload payload = 1;
|
||||
}
|
||||
|
||||
// A simple service to test the various types of RPCs and experiment with
|
||||
|
|
Loading…
Reference in New Issue