fabric-sdk-go: github.com/hyperledger/fabric-sdk-go/pkg/fab/events/client/lbp Index | Files

package lbp

import "github.com/hyperledger/fabric-sdk-go/pkg/fab/events/client/lbp"

Index

Package Files

lbp.go random.go roundrobin.go

type LoadBalancePolicy Uses

type LoadBalancePolicy interface {
    Choose(peers []fab.Peer) (fab.Peer, error)
}

LoadBalancePolicy chooses a peer from a set of peers

type Random Uses

type Random struct {
}

Random implements a random load-balance policy

func NewRandom Uses

func NewRandom() *Random

NewRandom returns a new Random load-balance policy

func (*Random) Choose Uses

func (lbp *Random) Choose(peers []fab.Peer) (fab.Peer, error)

Choose randomly chooses a peer from the list of peers

type RoundRobin Uses

type RoundRobin struct {
    // contains filtered or unexported fields
}

RoundRobin implements a round-robin load-balance policy

func NewRoundRobin Uses

func NewRoundRobin() *RoundRobin

NewRoundRobin returns a new RoundRobin load-balance policy

func (*RoundRobin) Choose Uses

func (lbp *RoundRobin) Choose(peers []fab.Peer) (fab.Peer, error)

Choose chooses from the list of peers in round-robin fashion

Package lbp imports 4 packages (graph) and is imported by 6 packages. Updated 2018-08-04. Refresh now. Tools for package owners.