Categorygithub.com/begonia-org/go-loadbalancer
modulepackage
0.0.0-20240519060752-71ca464f0f1a
Repository: https://github.com/begonia-org/go-loadbalancer.git
Documentation: pkg.go.dev

# Functions

No description provided by the author
No description provided by the author
const ( RRBalanceType BalanceType = "RoundRobin" WRRBalanceType BalanceType = "WeightedRoundRobin" ConsistentHashBalanceType BalanceType = "ConsistentHash" LCBalanceType BalanceType = "LeastConnection" SEDBalanceType BalanceType = "ShortestExpectedDelay" WLCBalanceType BalanceType = "WeightedLeastConnection" NQBalanceType BalanceType = "NeverQueue" ).
No description provided by the author
No description provided by the author
No description provided by the author
NewGrpcConnPool 创建一个grpc连接池.
No description provided by the author
No description provided by the author
No description provided by the author
NewLeastConnectionsBalance 创建一个最小连接数负载均衡器.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
WithConnectionUsedHook 设置连接使用的钩子函数.
WithDialer 设置连接池的拨号函数.
WithMaxActiveConns 设置连接池的最大活跃连接数.
WithMaxIdleConns 设置连接池的最大空闲连接数.
WithMinIdleConns 设置连接池的最小空闲连接数.
WithPoolSize 设置连接池的大小.
WithPoolTimeout 设置排队等待连接的超时时间.

# Constants

ConsistentHash.
LeastConnection 最小连接数.
NeverQueuejum.
RoundRobin 轮询.
ShortestExpectedDelay 最短期望延迟.
WeightedLeastConnection.
WeightedRoundRobin 加权轮询.

# Variables

No description provided by the author
ErrClosed performs any operation on the closed client will return this error.
No description provided by the author
No description provided by the author
ErrPoolExhausted is returned from a pool connection method when the maximum number of database connections in the pool has been reached.
ErrPoolTimeout timed out waiting to get a connection from the connection pool.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
LeastConnectionsBalance 最小连接数负载均衡.
No description provided by the author
No description provided by the author
No description provided by the author
RoundRobinBalance 轮询负载均衡 轮询(Round Robin): 轮询算法是一种分配算法, 它将每个新的请求按顺序分配给下一个服务器。当到达列表末尾时,算法再从列表的开始处继续分配。.
No description provided by the author
No description provided by the author
Stats contains pool state information and accumulated stats.
WeightedRoundRobinBalance 加权轮询负载均衡 加权轮询算法是一种分配算法,它根据服务器的不同处理能力分配不同的权重。 基于Nginx的加权轮询算法,Nginx的加权轮询算法是根据权重来分配请求的,权重越高的服务器,每次被选中的概率越大。 当前节点集初始值均为零:{0,0,0} 所有节点的当前权重值加上设定的权重值 在当前节点集中选取最大权重值的节点作为命中节点 命中节点的当前权重值减去总权重值作为其新权重值,其他节点保持不变.
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
HashCircle 一致性哈希环.
No description provided by the author