grpc_testing
v1.6.0
github.com/ppg/grpc-go/test/grpc_testing
Documentation
pkg.go.dev ↗Package grpc_testing is a generated protocol buffer package.
It is generated from these files:
grpc_testing/test.proto
It has these top-level messages:
Empty Payload SimpleRequest SimpleResponse StreamingInputCallRequest StreamingInputCallResponse ResponseParameters StreamingOutputCallRequest StreamingOutputCallResponse
Variables
PayloadType_name
var PayloadType_name = map[int32]string{
0: "COMPRESSABLE",
1: "UNCOMPRESSABLE",
2: "RANDOM",
}
PayloadType_value
var PayloadType_value = map[string]int32{
"COMPRESSABLE": 0,
"UNCOMPRESSABLE": 1,
"RANDOM": 2,
}
Functions
RegisterTestServiceServer
func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer)
Types
Empty
type Empty struct {
XXX_unrecognized []byte `json:"-"`
}
Empty.Descriptor
func (*Empty) Descriptor() ([]byte, []int)
Empty.ProtoMessage
func (*Empty) ProtoMessage()
Empty.Reset
func (m *Empty) Reset()
Empty.String
func (m *Empty) String() string
Payload
type Payload struct {
// The type of data in body.
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:"-"`
}
A block of data, to simply increase gRPC message size.
Payload.Descriptor
func (*Payload) Descriptor() ([]byte, []int)
Payload.GetBody
func (m *Payload) GetBody() []byte
Payload.GetType
func (m *Payload) GetType() PayloadType
Payload.ProtoMessage
func (*Payload) ProtoMessage()
Payload.Reset
func (m *Payload) Reset()
Payload.String
func (m *Payload) String() string
PayloadType
type PayloadType int32
The type of payload that should be returned.
PayloadType_COMPRESSABLE (3 declarations)
const ( // Compressable text format. PayloadType_COMPRESSABLE PayloadType = 0 // Uncompressable binary format. PayloadType_UNCOMPRESSABLE PayloadType = 1 // Randomly chosen from all other formats defined in this enum. PayloadType_RANDOM PayloadType = 2 )
PayloadType.Enum
func (x PayloadType) Enum() *PayloadType
PayloadType.EnumDescriptor
func (PayloadType) EnumDescriptor() ([]byte, []int)
PayloadType.String
func (x PayloadType) String() string
PayloadType.UnmarshalJSON
func (x *PayloadType) UnmarshalJSON(data []byte) error
ResponseParameters
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"`
// 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:"-"`
}
Configuration for a particular response.
ResponseParameters.Descriptor
func (*ResponseParameters) Descriptor() ([]byte, []int)
ResponseParameters.GetIntervalUs
func (m *ResponseParameters) GetIntervalUs() int32
ResponseParameters.GetSize
func (m *ResponseParameters) GetSize() int32
ResponseParameters.ProtoMessage
func (*ResponseParameters) ProtoMessage()
ResponseParameters.Reset
func (m *ResponseParameters) Reset()
ResponseParameters.String
func (m *ResponseParameters) String() string
SimpleRequest
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"`
// 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"`
// 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"`
// 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:"-"`
}
Unary request.
SimpleRequest.Descriptor
func (*SimpleRequest) Descriptor() ([]byte, []int)
SimpleRequest.GetFillOauthScope
func (m *SimpleRequest) GetFillOauthScope() bool
SimpleRequest.GetFillUsername
func (m *SimpleRequest) GetFillUsername() bool
SimpleRequest.GetPayload
func (m *SimpleRequest) GetPayload() *Payload
SimpleRequest.GetResponseSize
func (m *SimpleRequest) GetResponseSize() int32
SimpleRequest.GetResponseType
func (m *SimpleRequest) GetResponseType() PayloadType
SimpleRequest.ProtoMessage
func (*SimpleRequest) ProtoMessage()
SimpleRequest.Reset
func (m *SimpleRequest) Reset()
SimpleRequest.String
func (m *SimpleRequest) String() string
SimpleResponse
type SimpleResponse struct {
// Payload to increase message size.
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"`
// OAuth scope.
OauthScope *string `protobuf:"bytes,3,opt,name=oauth_scope,json=oauthScope" json:"oauth_scope,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
Unary response, as configured by the request.
SimpleResponse.Descriptor
func (*SimpleResponse) Descriptor() ([]byte, []int)
SimpleResponse.GetOauthScope
func (m *SimpleResponse) GetOauthScope() string
SimpleResponse.GetPayload
func (m *SimpleResponse) GetPayload() *Payload
SimpleResponse.GetUsername
func (m *SimpleResponse) GetUsername() string
SimpleResponse.ProtoMessage
func (*SimpleResponse) ProtoMessage()
SimpleResponse.Reset
func (m *SimpleResponse) Reset()
SimpleResponse.String
func (m *SimpleResponse) String() string
StreamingInputCallRequest
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:"-"`
}
Client-streaming request.
StreamingInputCallRequest.Descriptor
func (*StreamingInputCallRequest) Descriptor() ([]byte, []int)
StreamingInputCallRequest.GetPayload
func (m *StreamingInputCallRequest) GetPayload() *Payload
StreamingInputCallRequest.ProtoMessage
func (*StreamingInputCallRequest) ProtoMessage()
StreamingInputCallRequest.Reset
func (m *StreamingInputCallRequest) Reset()
StreamingInputCallRequest.String
func (m *StreamingInputCallRequest) String() string
StreamingInputCallResponse
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:"-"`
}
Client-streaming response.
StreamingInputCallResponse.Descriptor
func (*StreamingInputCallResponse) Descriptor() ([]byte, []int)
StreamingInputCallResponse.GetAggregatedPayloadSize
func (m *StreamingInputCallResponse) GetAggregatedPayloadSize() int32
StreamingInputCallResponse.ProtoMessage
func (*StreamingInputCallResponse) ProtoMessage()
StreamingInputCallResponse.Reset
func (m *StreamingInputCallResponse) Reset()
StreamingInputCallResponse.String
func (m *StreamingInputCallResponse) String() string
StreamingOutputCallRequest
type StreamingOutputCallRequest struct {
// Desired payload type in the response from the server.
// 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"`
// 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:"-"`
}
Server-streaming request.
StreamingOutputCallRequest.Descriptor
func (*StreamingOutputCallRequest) Descriptor() ([]byte, []int)
StreamingOutputCallRequest.GetPayload
func (m *StreamingOutputCallRequest) GetPayload() *Payload
StreamingOutputCallRequest.GetResponseParameters
func (m *StreamingOutputCallRequest) GetResponseParameters() []*ResponseParameters
StreamingOutputCallRequest.GetResponseType
func (m *StreamingOutputCallRequest) GetResponseType() PayloadType
StreamingOutputCallRequest.ProtoMessage
func (*StreamingOutputCallRequest) ProtoMessage()
StreamingOutputCallRequest.Reset
func (m *StreamingOutputCallRequest) Reset()
StreamingOutputCallRequest.String
func (m *StreamingOutputCallRequest) String() string
StreamingOutputCallResponse
type StreamingOutputCallResponse struct {
// Payload to increase response size.
Payload *Payload `protobuf:"bytes,1,opt,name=payload" json:"payload,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
Server-streaming response, as configured by the request and parameters.
StreamingOutputCallResponse.Descriptor
func (*StreamingOutputCallResponse) Descriptor() ([]byte, []int)
StreamingOutputCallResponse.GetPayload
func (m *StreamingOutputCallResponse) GetPayload() *Payload
StreamingOutputCallResponse.ProtoMessage
func (*StreamingOutputCallResponse) ProtoMessage()
StreamingOutputCallResponse.Reset
func (m *StreamingOutputCallResponse) Reset()
StreamingOutputCallResponse.String
func (m *StreamingOutputCallResponse) String() string
TestServiceClient
type TestServiceClient interface {
// One empty request followed by one empty response.
EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
// One request followed by one response.
// The server returns the client payload as-is.
UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error)
// One request followed by a sequence of responses (streamed download).
// The server returns the payload with client desired type and sizes.
StreamingOutputCall(ctx context.Context, in *StreamingOutputCallRequest, opts ...grpc.CallOption) (TestService_StreamingOutputCallClient, error)
// A sequence of requests followed by one response (streamed upload).
// The server returns the aggregated size of client payload as the result.
StreamingInputCall(ctx context.Context, opts ...grpc.CallOption) (TestService_StreamingInputCallClient, error)
// A sequence of requests with each request served by the server immediately.
// As one request could lead to multiple responses, this interface
// demonstrates the idea of full duplexing.
FullDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_FullDuplexCallClient, error)
// A sequence of requests followed by a sequence of responses.
// The server buffers all the client requests and then serves them in order. A
// stream of responses are returned to the client when the server starts with
// first request.
HalfDuplexCall(ctx context.Context, opts ...grpc.CallOption) (TestService_HalfDuplexCallClient, error)
}
NewTestServiceClient
func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient
TestServiceServer
type TestServiceServer interface {
// One empty request followed by one empty response.
EmptyCall(context.Context, *Empty) (*Empty, error)
// One request followed by one response.
// The server returns the client payload as-is.
UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error)
// One request followed by a sequence of responses (streamed download).
// The server returns the payload with client desired type and sizes.
StreamingOutputCall(*StreamingOutputCallRequest, TestService_StreamingOutputCallServer) error
// A sequence of requests followed by one response (streamed upload).
// The server returns the aggregated size of client payload as the result.
StreamingInputCall(TestService_StreamingInputCallServer) error
// A sequence of requests with each request served by the server immediately.
// As one request could lead to multiple responses, this interface
// demonstrates the idea of full duplexing.
FullDuplexCall(TestService_FullDuplexCallServer) error
// A sequence of requests followed by a sequence of responses.
// The server buffers all the client requests and then serves them in order. A
// stream of responses are returned to the client when the server starts with
// first request.
HalfDuplexCall(TestService_HalfDuplexCallServer) error
}
TestService_FullDuplexCallClient
type TestService_FullDuplexCallClient interface {
Send(*StreamingOutputCallRequest) error
Recv() (*StreamingOutputCallResponse, error)
grpc.ClientStream
}
TestService_FullDuplexCallServer
type TestService_FullDuplexCallServer interface {
Send(*StreamingOutputCallResponse) error
Recv() (*StreamingOutputCallRequest, error)
grpc.ServerStream
}
TestService_HalfDuplexCallClient
type TestService_HalfDuplexCallClient interface {
Send(*StreamingOutputCallRequest) error
Recv() (*StreamingOutputCallResponse, error)
grpc.ClientStream
}
TestService_HalfDuplexCallServer
type TestService_HalfDuplexCallServer interface {
Send(*StreamingOutputCallResponse) error
Recv() (*StreamingOutputCallRequest, error)
grpc.ServerStream
}
TestService_StreamingInputCallClient
type TestService_StreamingInputCallClient interface {
Send(*StreamingInputCallRequest) error
CloseAndRecv() (*StreamingInputCallResponse, error)
grpc.ClientStream
}
TestService_StreamingInputCallServer
type TestService_StreamingInputCallServer interface {
SendAndClose(*StreamingInputCallResponse) error
Recv() (*StreamingInputCallRequest, error)
grpc.ServerStream
}
TestService_StreamingOutputCallClient
type TestService_StreamingOutputCallClient interface {
Recv() (*StreamingOutputCallResponse, error)
grpc.ClientStream
}
TestService_StreamingOutputCallServer
type TestService_StreamingOutputCallServer interface {
Send(*StreamingOutputCallResponse) error
grpc.ServerStream
}