tunclient

package
v17.3.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 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        *slog.Logger
	Descriptor *info.APIDescriptor
	Client     rpc.ReverseTunnelClient
	// OwnServerConn is a connection to the gRPC server tunclient tunnels requests to.
	OwnServerConn 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