Server 表示一个后端服务器
| 6 | |
| 7 | // Server 表示一个后端服务器 |
| 8 | type Server struct { |
| 9 | Address string |
| 10 | Weight int |
| 11 | // 用于最小连接算法的当前连接数 |
| 12 | CurrentConnections int32 |
| 13 | // 用于轮询算法的当前权重 |
| 14 | CurrentWeight int |
| 15 | // 用于轮询算法的有效权重 |
| 16 | EffectiveWeight int |
| 17 | } |
| 18 | |
| 19 | // LoadBalancer 定义负载均衡器接口 |
| 20 | type LoadBalancer interface { |
nothing calls this directly
no outgoing calls
no test coverage detected