bufconn

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: MIT Imports: 5 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
	Target   string
	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, target string) *GRPCListener

func (*GRPCListener) Close

func (g *GRPCListener) Close()

func (*GRPCListener) Connect

func (g *GRPCListener) Connect(ctx context.Context, opts ...grpc.DialOption) (err error)

func (*GRPCListener) Dialer added in v1.5.0

func (g *GRPCListener) Dialer(context.Context, string) (net.Conn, 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