Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { *grpc.Server Listener *bufconn.Listener TLS *tls.Config // contains filtered or unexported fields }
Server is a gRPC server listening on a buffered stream, for use in end-to-end gRPC tests.
func NewServer ¶
func NewServer(opts ...grpc.ServerOption) *Server
NewServer returns a new insecure server. The caller should start the server by calling Serve on the returned type, and call Close when finished, to shut it down.
func NewTLSServer ¶
func NewTLSServer(opts ...grpc.ServerOption) *Server
NewTLSServer returns a new secure server. The caller should start the server by calling Serve on the returned type, and call Close when finished, to shut it down.
func (*Server) Certificate ¶
func (s *Server) Certificate() *x509.Certificate
Certificate returns the certificate used by the server, or nil if the server doesn't use TLS.
func (*Server) ClientConn ¶
func (s *Server) ClientConn(opts ...grpc.DialOption) (*grpc.ClientConn, error)
ClientConn returns a gRPC client connection configured for making requests to the server. It is configured to trust the server's TLS test certificate, if present, and will close its idle connections on Close.
func (*Server) ClientConnContext ¶
func (s *Server) ClientConnContext(ctx context.Context, opts ...grpc.DialOption) (*grpc.ClientConn, error)
ClientConnContext returns a gRPC client connection configured for making requests to the server. It is configured to trust the server's TLS test certificate, if present, and will close its idle connections on Close.