tunclient

package
v16.11.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIDescriptor

func APIDescriptor(server *grpc.Server) *info.APIDescriptor

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(descriptor *info.APIDescriptor, 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,
	descriptor *info.APIDescriptor, 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