testing

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MetadataReplyHeaders is a request header that contains values that will
	// be echoed back to the client as response headers. The format of the value
	// is "key: val". To have the server reply with more than one response
	// header, supply multiple values in request metadata.
	MetadataReplyHeaders = "reply-with-headers"
	// MetadataReplyTrailers is a request header that contains values that will
	// be echoed back to the client as response trailers. Its format its the
	// same as MetadataReplyHeaders.
	MetadataReplyTrailers = "reply-with-trailers"
	// MetadataFailEarly is a request header that, if present and not zero,
	// indicates that the RPC should fail immediately with that code.
	MetadataFailEarly = "fail-early"
	// MetadataFailLate is a request header that, if present and not zero,
	// indicates that the RPC should fail at the end with that code. This is
	// different from MetadataFailEarly only for streaming calls. An early
	// failure means the call to fail before any request stream is read or any
	// response stream is generated. A late failure means the entire request and
	// response streams will be consumed/processed and only then will the error
	// code be sent.
	MetadataFailLate = "fail-late"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type TestServer

type TestServer struct{}

TestServer implements the TestService interface defined in example.proto.

func (TestServer) EmptyCall

EmptyCall accepts one empty request and issues one empty response.

func (TestServer) FullDuplexCall

FullDuplexCall accepts 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.

func (TestServer) HalfDuplexCall

HalfDuplexCall accepts a sequence of requests and issues a sequence of responses. The server buffers all the client requests and then serves them in order. A stream of responses is returned to the client once the client half-closes the stream.

func (TestServer) StreamingInputCall

StreamingInputCall accepts a sequence of requests and issues one response (streamed upload). The server returns the aggregated size of client payloads as the result.

func (TestServer) StreamingOutputCall

StreamingOutputCall accepts one request and issues a sequence of responses (streamed download). The server returns the payload with client desired type and sizes as specified in the request's ResponseParameters.

func (TestServer) UnaryCall

UnaryCall accepts one request and issues one response. The response includes the client's payload as-is.

Directories

Path Synopsis
cmd
testserver
Command testserver spins up a test GRPC server.
Command testserver spins up a test GRPC server.

Jump to

Keyboard shortcuts

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