Documentation ¶
Index ¶
- func AddConnection(pool *[]*Connection, con *Connection)
- func CloseAllConnections(pool *[]*Connection)
- func Connect(t *http2.Transport, host string) (*http2.ClientConn, error)
- func ConnectPool(t *http2.Transport, pool []*Connection) error
- func RefreshConnections(pool *[]*Connection, refreshedAddrs []string)
- type Connection
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 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
Click to show internal directories.
Click to hide internal directories.