Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { Name string Instances []*ServerInstance // contains filtered or unexported fields }
func (*App) Get ¶
func (a *App) Get(key string) *ServerInstance
type Balancer ¶
type Balancer interface {
Next(key string, hosts []*ServerInstance) *ServerInstance
}
负载均衡器接口
type HashBalancer ¶
type HashBalancer struct { }
func (*HashBalancer) Next ¶
func (h *HashBalancer) Next(key string, hosts []*ServerInstance) *ServerInstance
type RandomBalancer ¶
type RandomBalancer struct { }
随机负载均衡算法
func (*RandomBalancer) Next ¶
func (r *RandomBalancer) Next(key string, hosts []*ServerInstance) *ServerInstance
type RoundRobinBalancer ¶
type RoundRobinBalancer struct {
// contains filtered or unexported fields
}
简单轮询负载均衡算法
func (*RoundRobinBalancer) Next ¶
func (r *RoundRobinBalancer) Next(key string, hosts []*ServerInstance) *ServerInstance
Click to show internal directories.
Click to hide internal directories.