MCPcopy Create free account
hub / github.com/catwithtudou/load-balancer-algorithm / LoadBalancer

Interface LoadBalancer

loadbalancer/load_balancer.go:20–27  ·  view source on GitHub ↗

LoadBalancer 定义负载均衡器接口

Source from the content-addressed store, hash-verified

18
19// LoadBalancer 定义负载均衡器接口
20type LoadBalancer interface {
21 // AddServer 添加服务器
22 AddServer(server *Server)
23 // RemoveServer 移除服务器
24 RemoveServer(address string)
25 // GetServer 获取下一个服务器
26 GetServer(key string) *Server
27}
28
29// BaseLoadBalancer 基础负载均衡器结构
30type BaseLoadBalancer struct {

Callers 2

mainFunction · 0.65
AddServerMethod · 0.65

Implementers 2

MaglevHashLoadBalancerloadbalancer/consistent_hash.go
LeastConnectionsLoadBalancerloadbalancer/least_connections.go

Calls

no outgoing calls

Tested by

no test coverage detected