Documentation ¶
Overview ¶
Package testserver implements a simple gRPC server and client to use for testing. It will listen to a random port locally, and initialize the server and client ends.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GRPCTestServer ¶
type GRPCTestServer struct { Server *grpc.Server Conn *grpc.ClientConn // contains filtered or unexported fields }
GRPCTestServer provides the Server and Conn (client).
func New ¶
func New(opts ...grpcserver.ServerOption) *GRPCTestServer
New returns a new GRPCTestServer, configured to listen on a random local port.
func (*GRPCTestServer) Close ¶
func (t *GRPCTestServer) Close() error
Close closes the client connection, and stops the server from listening.
func (*GRPCTestServer) Dial ¶
func (t *GRPCTestServer) Dial(opts ...grpc.DialOption) (*grpc.ClientConn, error)
Dial initiates a new gRPC connection to the server with the provided dial options.
func (*GRPCTestServer) Start ¶
func (t *GRPCTestServer) Start() error
Start will start the gRPC server in a goroutine.
Click to show internal directories.
Click to hide internal directories.