bufconn

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCListener

type GRPCListener struct {
	Listener *bufconn.Listener
	Conn     *grpc.ClientConn
}

GRPCListener handles gRPC connections using a bufconn listener. This is useful for testing when it's unnecessary to have a live gRPC server running. The normal workflow is to call New() to start the listener, Connect() to start a gRPC connection under which to send client calls, Close() to close the connection, and Release() to close the listener.

func New

func New(bufSize int) *GRPCListener

func (*GRPCListener) Close

func (g *GRPCListener) Close()

func (*GRPCListener) Connect

func (g *GRPCListener) Connect(creds grpc.DialOption) (err error)

func (*GRPCListener) Release

func (s *GRPCListener) Release()

Jump to

Keyboard shortcuts

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