testing

package
v2.0.0-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadProtoset

func LoadProtoset(path string) (protoreflect.FileDescriptor, error)

LoadProtoset loads the compiled protoset file at the given path. It returns the last file descriptor in the set. When generating a protoset for a single file, that file is always last (and its dependencies before it).

Types

type TestService

type TestService struct {
	grpc.UnimplementedTestServiceServer
}

TestService is a very simple test service that just echos back request payloads

func (TestService) EmptyCall

func (TestService) EmptyCall(_ context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)

EmptyCall satisfies the grpc.TestServiceServer interface. It always succeeds.

func (TestService) FullDuplexCall

FullDuplexCall satisfies the grpc.TestServiceServer interface. It only fails if the client cancels or disconnects (thus causing ss.Send to return an error). For each request message it receives, it sends back a response message with the same payload.

func (TestService) HalfDuplexCall

HalfDuplexCall satisfies the grpc.TestServiceServer interface. It only fails if the client cancels or disconnects (thus causing ss.Send to return an error). For each request message it receives, it sends back a response message with the same payload. But since it is half-duplex, all of the request payloads are buffered and responses will only be sent after the request stream is half-closed.

func (TestService) StreamingInputCall

StreamingInputCall satisfies the grpc.TestServiceServer interface. It always succeeds, sending back the total observed size of all request payloads.

func (TestService) StreamingOutputCall

StreamingOutputCall satisfies the grpc.TestServiceServer interface. It only fails if the client cancels or disconnects (thus causing ss.Send to return an error). It echoes a number of responses equal to the request's number of response parameters. The requested parameter details, however, ignored. The response payload is always an echo of the request payload.

func (TestService) UnaryCall

UnaryCall satisfies the grpc.TestServiceServer interface. It always succeeds, echoing back the payload present in the request.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL