Documentation
¶
Index ¶
Constants ¶
View Source
const ( RANDOM = "random" ROUNDROBIN = "round-robin" VERSIONSCALE = "weighted-version" HASH = "hash" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Balancer ¶
type Balancer interface { Name() string Pick(peers []*ServicePeer) (picked *ServicePeer, err error) UpdateScales(scale map[string]int) Balancer Clone() Balancer }
type ServicePeer ¶
type ServicePeer struct { Record *store.ServiceRecord Conn *grpc.ClientConn Meta map[string]interface{} }
func EmptyPeer ¶
func EmptyPeer() *ServicePeer
func NewPeer ¶
func NewPeer(r *store.ServiceRecord, c *grpc.ClientConn) *ServicePeer
func (*ServicePeer) String ¶
func (sp *ServicePeer) String() (s string)
Click to show internal directories.
Click to hide internal directories.