balance

package
v0.0.0-...-63a9e4b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2020 License: MIT Imports: 3 Imported by: 0

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 Balancers

type Balancers map[string]Balancer

type ServicePeer

type ServicePeer struct {
	Record *store.ServiceRecord
	Conn   *grpc.ClientConn
	Meta   map[string]interface{}
}

func EmptyPeer

func EmptyPeer() *ServicePeer

func NewPeer

func (*ServicePeer) String

func (sp *ServicePeer) String() (s string)

type SvcRec

type SvcRec interface {
}

Never Used.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL