grpcurl: github.com/fullstorydev/grpcurl/testing Index | Files | Directories

package testing

import "github.com/fullstorydev/grpcurl/testing"

Index

Package Files

test_server.go

Constants

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

type TestServer Uses

type TestServer struct{}

TestServer implements the TestService interface defined in example.proto.

func (TestServer) EmptyCall Uses

func (TestServer) EmptyCall(ctx context.Context, req *grpc_testing.Empty) (*grpc_testing.Empty, error)

EmptyCall accepts one empty request and issues one empty response.

func (TestServer) FullDuplexCall Uses

func (TestServer) FullDuplexCall(str grpc_testing.TestService_FullDuplexCallServer) error

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 Uses

func (TestServer) HalfDuplexCall(str grpc_testing.TestService_HalfDuplexCallServer) error

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 Uses

func (TestServer) StreamingInputCall(str grpc_testing.TestService_StreamingInputCallServer) error

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 Uses

func (TestServer) StreamingOutputCall(req *grpc_testing.StreamingOutputCallRequest, str grpc_testing.TestService_StreamingOutputCallServer) error

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 Uses

func (TestServer) UnaryCall(ctx context.Context, req *grpc_testing.SimpleRequest) (*grpc_testing.SimpleResponse, error)

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

Directories

PathSynopsis
jsonpb_test_proto

Package testing imports 10 packages (graph). Updated 2020-04-07. Refresh now. Tools for package owners.