Documentation ¶
Index ¶
- func Ceq(t *testing.T, expected, actual interface{}, eq func(a, b interface{}) bool, ...) bool
- func Cneq(t *testing.T, unexpected, actual interface{}, eq func(a, b interface{}) bool, ...) bool
- func Eq(t *testing.T, expected, actual interface{}, context ...interface{}) bool
- func Neq(t *testing.T, unexpected, actual interface{}, context ...interface{}) bool
- func Nok(t *testing.T, err error, context ...interface{})
- func Ok(t *testing.T, err error, context ...interface{})
- func Require(t *testing.T, condition bool, context ...interface{})
- type TestService
- func (TestService) EmptyCall(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
- func (TestService) FullDuplexCall(ss grpc_testing.TestService_FullDuplexCallServer) error
- func (TestService) HalfDuplexCall(ss grpc_testing.TestService_HalfDuplexCallServer) error
- func (TestService) StreamingInputCall(ss grpc_testing.TestService_StreamingInputCallServer) error
- func (TestService) StreamingOutputCall(req *grpc_testing.StreamingOutputCallRequest, ...) error
- func (TestService) UnaryCall(_ context.Context, req *grpc_testing.SimpleRequest) (*grpc_testing.SimpleResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ceq ¶
func Ceq(t *testing.T, expected, actual interface{}, eq func(a, b interface{}) bool, context ...interface{}) bool
Ceq is a custom equals check; the given function returns true if its arguments are equal
func Cneq ¶
func Cneq(t *testing.T, unexpected, actual interface{}, eq func(a, b interface{}) bool, context ...interface{}) bool
Cneq is a custom not-equals check; the given function returns true if its arguments are equal
Types ¶
type TestService ¶
type TestService struct {
grpc_testing.UnimplementedTestServiceServer
}
TestService is a very simple test service that just echos back request payloads
func (TestService) EmptyCall ¶
EmptyCall satisfies the grpc_testing.TestServiceServer interface. It always succeeds.
func (TestService) FullDuplexCall ¶
func (TestService) FullDuplexCall(ss grpc_testing.TestService_FullDuplexCallServer) error
FullDuplexCall satisfies the grpc_testing.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 ¶
func (TestService) HalfDuplexCall(ss grpc_testing.TestService_HalfDuplexCallServer) error
HalfDuplexCall satisfies the grpc_testing.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 ¶
func (TestService) StreamingInputCall(ss grpc_testing.TestService_StreamingInputCallServer) error
StreamingInputCall satisfies the grpc_testing.TestServiceServer interface. It always succeeds, sending back the total observed size of all request payloads.
func (TestService) StreamingOutputCall ¶
func (TestService) StreamingOutputCall(req *grpc_testing.StreamingOutputCallRequest, ss grpc_testing.TestService_StreamingOutputCallServer) error
StreamingOutputCall satisfies the grpc_testing.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 ¶
func (TestService) UnaryCall(_ context.Context, req *grpc_testing.SimpleRequest) (*grpc_testing.SimpleResponse, error)
UnaryCall satisfies the grpc_testing.TestServiceServer interface. It always succeeds, echoing back the payload present in the request.