net

package
v1.5.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectPool

type ConnectPool struct {
	ConnectType      connectType
	HostCheckTimeGap time.Duration
	HostCheckTimeout time.Duration
	BreakerFailTimes int
	BreakerTryTimes  int
	// contains filtered or unexported fields
}

ConnectPool describe a connection pools, provides health check and circuit breaker to maintains those connection via different address.

func NewConnectPool

func NewConnectPool(address []string) *ConnectPool

NewConnectPool get a new ConnectPool with given address. Those address should be the same service and equal to each other.

func (*ConnectPool) GetAddress

func (cp *ConnectPool) GetAddress() string

GetAddress return a available address(for now) in address list.

func (*ConnectPool) Start

func (cp *ConnectPool) Start()

Start the connect pool.

func (*ConnectPool) Stop

func (cp *ConnectPool) Stop()

Stop the connect pool.

Jump to

Keyboard shortcuts

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