Documentation ¶
Overview ¶
Package testing contains a test fixture for working with gRPC over HTTP/2.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // CA is the certificate authority. It uses the Cybervillains key pair. CA *x509.Certificate // CAKey is the private key of the certificate authority. CAKey crypto.PrivateKey // RootCAs is a certificate pool containing `CA`. RootCAs *x509.CertPool // ClientTLS is a set of transport credentials to use with chains signed by `CA`. ClientTLS credentials.TransportCredentials // Localhost is a certificate for "localhost" signed by `CA`. Localhost *tls.Certificate )
Functions ¶
This section is empty.
Types ¶
type Fixture ¶
type Fixture struct { // TestServiceClient is a client pointing at the service and redirected through the proxy. tspb.TestServiceClient // contains filtered or unexported fields }
Fixture encapsulates the TestService gRPC server, a proxy and a gRPC client.
type Server ¶
type Server struct {
tspb.UnimplementedTestServiceServer
}
Server is a testing gRPC server.
func (*Server) DoubleEcho ¶
func (s *Server) DoubleEcho(stream tspb.TestService_DoubleEchoServer) error
DoubleEcho handles TestService.DoubleEcho RPCs.
func (*Server) Echo ¶
func (s *Server) Echo(_ context.Context, in *tspb.EchoRequest) (*tspb.EchoResponse, error)
Echo handles TestService.Echo RPCs.
func (*Server) Sum ¶
func (s *Server) Sum(_ context.Context, in *tspb.SumRequest) (*tspb.SumResponse, error)
Sum handles TestService.Sum RPCs.
Click to show internal directories.
Click to hide internal directories.