grpc: google.golang.org/grpc/test/grpc_testing Index | Files

package grpc_testing

import "google.golang.org/grpc/test/grpc_testing"

Index

Package Files

test.pb.go test_grpc.pb.go

Variables

var (
    PayloadType_name = map[int32]string{
        0:  "COMPRESSABLE",
        1:  "UNCOMPRESSABLE",
        2:  "RANDOM",
    }
    PayloadType_value = map[string]int32{
        "COMPRESSABLE":   0,
        "UNCOMPRESSABLE": 1,
        "RANDOM":         2,
    }
)

Enum value maps for PayloadType.

var File_test_grpc_testing_test_proto protoreflect.FileDescriptor

func RegisterTestServiceServer Uses

func RegisterTestServiceServer(s grpc.ServiceRegistrar, srv TestServiceServer)

type Empty Uses

type Empty struct {
    // contains filtered or unexported fields
}

func (*Empty) Descriptor Uses

func (*Empty) Descriptor() ([]byte, []int)

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage Uses

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect Uses

func (x *Empty) ProtoReflect() protoreflect.Message

func (*Empty) Reset Uses

func (x *Empty) Reset()

func (*Empty) String Uses

func (x *Empty) String() string

type Payload Uses

type Payload struct {

    // The type of data in body.
    Type PayloadType `protobuf:"varint,1,opt,name=type,proto3,enum=grpc.testing.PayloadType" json:"type,omitempty"`
    // Primary contents of payload.
    Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
    // contains filtered or unexported fields
}

A block of data, to simply increase gRPC message size.

func (*Payload) Descriptor Uses

func (*Payload) Descriptor() ([]byte, []int)

Deprecated: Use Payload.ProtoReflect.Descriptor instead.

func (*Payload) GetBody Uses

func (x *Payload) GetBody() []byte

func (*Payload) GetType Uses

func (x *Payload) GetType() PayloadType

func (*Payload) ProtoMessage Uses

func (*Payload) ProtoMessage()

func (*Payload) ProtoReflect Uses

func (x *Payload) ProtoReflect() protoreflect.Message

func (*Payload) Reset Uses

func (x *Payload) Reset()

func (*Payload) String Uses

func (x *Payload) String() string

type PayloadType Uses

type PayloadType int32

The type of payload that should be returned.

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
)

func (PayloadType) Descriptor Uses

func (PayloadType) Descriptor() protoreflect.EnumDescriptor

func (PayloadType) Enum Uses

func (x PayloadType) Enum() *PayloadType

func (PayloadType) EnumDescriptor Uses

func (PayloadType) EnumDescriptor() ([]byte, []int)

Deprecated: Use PayloadType.Descriptor instead.

func (PayloadType) Number Uses

func (x PayloadType) Number() protoreflect.EnumNumber

func (PayloadType) String Uses

func (x PayloadType) String() string

func (PayloadType) Type Uses

func (PayloadType) Type() protoreflect.EnumType

type ResponseParameters Uses

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,proto3" 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,proto3" json:"interval_us,omitempty"`
    // contains filtered or unexported fields
}

Configuration for a particular response.

func (*ResponseParameters) Descriptor Uses

func (*ResponseParameters) Descriptor() ([]byte, []int)

Deprecated: Use ResponseParameters.ProtoReflect.Descriptor instead.

func (*ResponseParameters) GetIntervalUs Uses

func (x *ResponseParameters) GetIntervalUs() int32

func (*ResponseParameters) GetSize Uses

func (x *ResponseParameters) GetSize() int32

func (*ResponseParameters) ProtoMessage Uses

func (*ResponseParameters) ProtoMessage()

func (*ResponseParameters) ProtoReflect Uses

func (x *ResponseParameters) ProtoReflect() protoreflect.Message

func (*ResponseParameters) Reset Uses

func (x *ResponseParameters) Reset()

func (*ResponseParameters) String Uses

func (x *ResponseParameters) String() string

type SimpleRequest Uses

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,proto3,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,proto3" json:"response_size,omitempty"`
    // Optional input payload sent along with the request.
    Payload *Payload `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
    // Whether SimpleResponse should include username.
    FillUsername bool `protobuf:"varint,4,opt,name=fill_username,json=fillUsername,proto3" json:"fill_username,omitempty"`
    // Whether SimpleResponse should include OAuth scope.
    FillOauthScope bool `protobuf:"varint,5,opt,name=fill_oauth_scope,json=fillOauthScope,proto3" json:"fill_oauth_scope,omitempty"`
    // contains filtered or unexported fields
}

Unary request.

func (*SimpleRequest) Descriptor Uses

func (*SimpleRequest) Descriptor() ([]byte, []int)

Deprecated: Use SimpleRequest.ProtoReflect.Descriptor instead.

func (*SimpleRequest) GetFillOauthScope Uses

func (x *SimpleRequest) GetFillOauthScope() bool

func (*SimpleRequest) GetFillUsername Uses

func (x *SimpleRequest) GetFillUsername() bool

func (*SimpleRequest) GetPayload Uses

func (x *SimpleRequest) GetPayload() *Payload

func (*SimpleRequest) GetResponseSize Uses

func (x *SimpleRequest) GetResponseSize() int32

func (*SimpleRequest) GetResponseType Uses

func (x *SimpleRequest) GetResponseType() PayloadType

func (*SimpleRequest) ProtoMessage Uses

func (*SimpleRequest) ProtoMessage()

func (*SimpleRequest) ProtoReflect Uses

func (x *SimpleRequest) ProtoReflect() protoreflect.Message

func (*SimpleRequest) Reset Uses

func (x *SimpleRequest) Reset()

func (*SimpleRequest) String Uses

func (x *SimpleRequest) String() string

type SimpleResponse Uses

type SimpleResponse struct {

    // Payload to increase message size.
    Payload *Payload `protobuf:"bytes,1,opt,name=payload,proto3" 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,proto3" json:"username,omitempty"`
    // OAuth scope.
    OauthScope string `protobuf:"bytes,3,opt,name=oauth_scope,json=oauthScope,proto3" json:"oauth_scope,omitempty"`
    // contains filtered or unexported fields
}

Unary response, as configured by the request.

func (*SimpleResponse) Descriptor Uses

func (*SimpleResponse) Descriptor() ([]byte, []int)

Deprecated: Use SimpleResponse.ProtoReflect.Descriptor instead.

func (*SimpleResponse) GetOauthScope Uses

func (x *SimpleResponse) GetOauthScope() string

func (*SimpleResponse) GetPayload Uses

func (x *SimpleResponse) GetPayload() *Payload

func (*SimpleResponse) GetUsername Uses

func (x *SimpleResponse) GetUsername() string

func (*SimpleResponse) ProtoMessage Uses

func (*SimpleResponse) ProtoMessage()

func (*SimpleResponse) ProtoReflect Uses

func (x *SimpleResponse) ProtoReflect() protoreflect.Message

func (*SimpleResponse) Reset Uses

func (x *SimpleResponse) Reset()

func (*SimpleResponse) String Uses

func (x *SimpleResponse) String() string

type StreamingInputCallRequest Uses

type StreamingInputCallRequest struct {

    // Optional input payload sent along with the request.
    Payload *Payload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
    // contains filtered or unexported fields
}

Client-streaming request.

func (*StreamingInputCallRequest) Descriptor Uses

func (*StreamingInputCallRequest) Descriptor() ([]byte, []int)

Deprecated: Use StreamingInputCallRequest.ProtoReflect.Descriptor instead.

func (*StreamingInputCallRequest) GetPayload Uses

func (x *StreamingInputCallRequest) GetPayload() *Payload

func (*StreamingInputCallRequest) ProtoMessage Uses

func (*StreamingInputCallRequest) ProtoMessage()

func (*StreamingInputCallRequest) ProtoReflect Uses

func (x *StreamingInputCallRequest) ProtoReflect() protoreflect.Message

func (*StreamingInputCallRequest) Reset Uses

func (x *StreamingInputCallRequest) Reset()

func (*StreamingInputCallRequest) String Uses

func (x *StreamingInputCallRequest) String() string

type StreamingInputCallResponse Uses

type StreamingInputCallResponse struct {

    // Aggregated size of payloads received from the client.
    AggregatedPayloadSize int32 `protobuf:"varint,1,opt,name=aggregated_payload_size,json=aggregatedPayloadSize,proto3" json:"aggregated_payload_size,omitempty"`
    // contains filtered or unexported fields
}

Client-streaming response.

func (*StreamingInputCallResponse) Descriptor Uses

func (*StreamingInputCallResponse) Descriptor() ([]byte, []int)

Deprecated: Use StreamingInputCallResponse.ProtoReflect.Descriptor instead.

func (*StreamingInputCallResponse) GetAggregatedPayloadSize Uses

func (x *StreamingInputCallResponse) GetAggregatedPayloadSize() int32

func (*StreamingInputCallResponse) ProtoMessage Uses

func (*StreamingInputCallResponse) ProtoMessage()

func (*StreamingInputCallResponse) ProtoReflect Uses

func (x *StreamingInputCallResponse) ProtoReflect() protoreflect.Message

func (*StreamingInputCallResponse) Reset Uses

func (x *StreamingInputCallResponse) Reset()

func (*StreamingInputCallResponse) String Uses

func (x *StreamingInputCallResponse) String() string

type StreamingOutputCallRequest Uses

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,proto3,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,proto3" json:"response_parameters,omitempty"`
    // Optional input payload sent along with the request.
    Payload *Payload `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
    // contains filtered or unexported fields
}

Server-streaming request.

func (*StreamingOutputCallRequest) Descriptor Uses

func (*StreamingOutputCallRequest) Descriptor() ([]byte, []int)

Deprecated: Use StreamingOutputCallRequest.ProtoReflect.Descriptor instead.

func (*StreamingOutputCallRequest) GetPayload Uses

func (x *StreamingOutputCallRequest) GetPayload() *Payload

func (*StreamingOutputCallRequest) GetResponseParameters Uses

func (x *StreamingOutputCallRequest) GetResponseParameters() []*ResponseParameters

func (*StreamingOutputCallRequest) GetResponseType Uses

func (x *StreamingOutputCallRequest) GetResponseType() PayloadType

func (*StreamingOutputCallRequest) ProtoMessage Uses

func (*StreamingOutputCallRequest) ProtoMessage()

func (*StreamingOutputCallRequest) ProtoReflect Uses

func (x *StreamingOutputCallRequest) ProtoReflect() protoreflect.Message

func (*StreamingOutputCallRequest) Reset Uses

func (x *StreamingOutputCallRequest) Reset()

func (*StreamingOutputCallRequest) String Uses

func (x *StreamingOutputCallRequest) String() string

type StreamingOutputCallResponse Uses

type StreamingOutputCallResponse struct {

    // Payload to increase response size.
    Payload *Payload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
    // contains filtered or unexported fields
}

Server-streaming response, as configured by the request and parameters.

func (*StreamingOutputCallResponse) Descriptor Uses

func (*StreamingOutputCallResponse) Descriptor() ([]byte, []int)

Deprecated: Use StreamingOutputCallResponse.ProtoReflect.Descriptor instead.

func (*StreamingOutputCallResponse) GetPayload Uses

func (x *StreamingOutputCallResponse) GetPayload() *Payload

func (*StreamingOutputCallResponse) ProtoMessage Uses

func (*StreamingOutputCallResponse) ProtoMessage()

func (*StreamingOutputCallResponse) ProtoReflect Uses

func (x *StreamingOutputCallResponse) ProtoReflect() protoreflect.Message

func (*StreamingOutputCallResponse) Reset Uses

func (x *StreamingOutputCallResponse) Reset()

func (*StreamingOutputCallResponse) String Uses

func (x *StreamingOutputCallResponse) String() string

type TestServiceClient Uses

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)
}

TestServiceClient is the client API for TestService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewTestServiceClient Uses

func NewTestServiceClient(cc grpc.ClientConnInterface) TestServiceClient

type TestServiceServer Uses

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
    // contains filtered or unexported methods
}

TestServiceServer is the server API for TestService service. All implementations must embed UnimplementedTestServiceServer for forward compatibility

type TestService_FullDuplexCallClient Uses

type TestService_FullDuplexCallClient interface {
    Send(*StreamingOutputCallRequest) error
    Recv() (*StreamingOutputCallResponse, error)
    grpc.ClientStream
}

type TestService_FullDuplexCallServer Uses

type TestService_FullDuplexCallServer interface {
    Send(*StreamingOutputCallResponse) error
    Recv() (*StreamingOutputCallRequest, error)
    grpc.ServerStream
}

type TestService_HalfDuplexCallClient Uses

type TestService_HalfDuplexCallClient interface {
    Send(*StreamingOutputCallRequest) error
    Recv() (*StreamingOutputCallResponse, error)
    grpc.ClientStream
}

type TestService_HalfDuplexCallServer Uses

type TestService_HalfDuplexCallServer interface {
    Send(*StreamingOutputCallResponse) error
    Recv() (*StreamingOutputCallRequest, error)
    grpc.ServerStream
}

type TestService_StreamingInputCallClient Uses

type TestService_StreamingInputCallClient interface {
    Send(*StreamingInputCallRequest) error
    CloseAndRecv() (*StreamingInputCallResponse, error)
    grpc.ClientStream
}

type TestService_StreamingInputCallServer Uses

type TestService_StreamingInputCallServer interface {
    SendAndClose(*StreamingInputCallResponse) error
    Recv() (*StreamingInputCallRequest, error)
    grpc.ServerStream
}

type TestService_StreamingOutputCallClient Uses

type TestService_StreamingOutputCallClient interface {
    Recv() (*StreamingOutputCallResponse, error)
    grpc.ClientStream
}

type TestService_StreamingOutputCallServer Uses

type TestService_StreamingOutputCallServer interface {
    Send(*StreamingOutputCallResponse) error
    grpc.ServerStream
}

type UnimplementedTestServiceServer Uses

type UnimplementedTestServiceServer struct {
}

UnimplementedTestServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedTestServiceServer) EmptyCall Uses

func (UnimplementedTestServiceServer) EmptyCall(context.Context, *Empty) (*Empty, error)

func (UnimplementedTestServiceServer) FullDuplexCall Uses

func (UnimplementedTestServiceServer) FullDuplexCall(TestService_FullDuplexCallServer) error

func (UnimplementedTestServiceServer) HalfDuplexCall Uses

func (UnimplementedTestServiceServer) HalfDuplexCall(TestService_HalfDuplexCallServer) error

func (UnimplementedTestServiceServer) StreamingInputCall Uses

func (UnimplementedTestServiceServer) StreamingInputCall(TestService_StreamingInputCallServer) error

func (UnimplementedTestServiceServer) StreamingOutputCall Uses

func (UnimplementedTestServiceServer) StreamingOutputCall(*StreamingOutputCallRequest, TestService_StreamingOutputCallServer) error

func (UnimplementedTestServiceServer) UnaryCall Uses

func (UnimplementedTestServiceServer) UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error)

type UnsafeTestServiceServer Uses

type UnsafeTestServiceServer interface {
    // contains filtered or unexported methods
}

UnsafeTestServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TestServiceServer will result in compilation errors.

Package grpc_testing imports 9 packages (graph) and is imported by 4 packages. Updated 2020-10-23. Refresh now. Tools for package owners.