grpc_lb

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxStreamPreConn = 4
	CCIdleTimeout           = time.Second * 60
)

Variables

This section is empty.

Functions

func NewGrpcPeerConn

func NewGrpcPeerConn(s grpc_tunnel.TunnelPeer) net.Conn

Types

type ConnPool

type ConnPool struct {
	// contains filtered or unexported fields
}

func NewConnPool

func NewConnPool(opts ConnPoolOpts) *ConnPool

func (*ConnPool) GetConn

func (p *ConnPool) GetConn(ctx context.Context) (net.Conn, error)

type ConnPoolOpts

type ConnPoolOpts struct {
	Target           string
	MaxStreamPerConn int
	ServiceName      string

	// DialOpts for grpc.Dial. Must not have grpc.WithBlock.
	DialOpts []grpc.DialOption

	Logger *zap.Logger
}

type GrpcPeerRWCWrapper

type GrpcPeerRWCWrapper struct {
	// contains filtered or unexported fields
}

func (*GrpcPeerRWCWrapper) Close

func (g *GrpcPeerRWCWrapper) Close() error

func (*GrpcPeerRWCWrapper) LocalAddr

func (g *GrpcPeerRWCWrapper) LocalAddr() net.Addr

func (*GrpcPeerRWCWrapper) Read

func (g *GrpcPeerRWCWrapper) Read(p []byte) (n int, err error)

func (*GrpcPeerRWCWrapper) RemoteAddr

func (g *GrpcPeerRWCWrapper) RemoteAddr() net.Addr

func (*GrpcPeerRWCWrapper) SetDeadline

func (g *GrpcPeerRWCWrapper) SetDeadline(t time.Time) error

func (*GrpcPeerRWCWrapper) SetReadDeadline

func (g *GrpcPeerRWCWrapper) SetReadDeadline(t time.Time) error

func (*GrpcPeerRWCWrapper) SetWriteDeadline

func (g *GrpcPeerRWCWrapper) SetWriteDeadline(t time.Time) error

func (*GrpcPeerRWCWrapper) Write

func (g *GrpcPeerRWCWrapper) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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