testserver

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2019 License: BSD-3-Clause Imports: 3 Imported by: 0

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL