tunclient

package
v17.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type Connection

type Connection struct {
	Log                *zap.Logger
	Descriptor         *info.APIDescriptor
	Client             rpc.ReverseTunnelClient
	InternalServerConn grpc.ClientConnInterface
	PollConfig         retry.PollConfigFactory
	OnActive           func(ConnectionInterface)
	OnIdle             func(ConnectionInterface)
}

func (*Connection) Run

func (c *Connection) Run(attemptCtx, pollCtx context.Context)

type ConnectionFactory

type ConnectionFactory func(onActive, onIdle func(ConnectionInterface)) ConnectionInterface

ConnectionFactory helps to inject fake connections for testing.

type ConnectionInterface

type ConnectionInterface interface {
	Run(attemptCtx, pollCtx context.Context)
}

type ConnectionManager

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

ConnectionManager manages a pool of connections and their lifecycles.

func NewConnectionManager

func NewConnectionManager(minIdleConnections, maxConnections, scaleUpStep int32, maxIdleTime time.Duration,
	connectionFactory ConnectionFactory) *ConnectionManager

func (*ConnectionManager) Run

func (m *ConnectionManager) Run(ctx context.Context)

Jump to

Keyboard shortcuts

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