conn

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddConnection

func AddConnection(pool *[]*Connection, con *Connection)

AddConnection adds a new connection to the pool if it is not duplicated

func CloseAllConnections

func CloseAllConnections(pool *[]*Connection)

CloseAllConnections closes all connections in the pool

func Connect

func Connect(t *http2.Transport, host string) (*http2.ClientConn, error)

Connect creates a new connection

func ConnectPool

func ConnectPool(t *http2.Transport, pool []*Connection) error

ConnectPool creates the actual connections available in the pool for those connections marked as active and not connected

func RefreshConnections

func RefreshConnections(pool *[]*Connection, refreshedAddrs []string)

RefreshConnections compares the refreshed IPs removing the non existing ones and creating the new ones

Types

type Connection

type Connection struct {
	Address     string
	Conn        *http2.ClientConn
	IsConnected bool // used to init the connection after rehresing the ips
	IsActive    bool // indicates if the connection is active, can be deactivated/remmoved in case of multiple failures (TODO: circuit break)
}

Connection represents the connection for an specific Address

Jump to

Keyboard shortcuts

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