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

package preferorg

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


Package Files

opts.go preferorg.go

func NewResolver Uses

func NewResolver() peerresolver.Provider

NewResolver returns a new "prefer org" resolver provider.

type PeerResolver Uses

type PeerResolver struct {
    // contains filtered or unexported fields

PeerResolver is a peer resolver that determines which peers are suitable based on block height, although will prefer the peers in the current org (as long as their block height is above a configured threshold). If none of the peers from the current org are suitable then a peer from another org is chosen.

func New Uses

func New(dispatcher service.Dispatcher, context context.Client, channelID string, opts ...options.Opt) *PeerResolver

New returns a new "prefer org" resolver.

func (*PeerResolver) Resolve Uses

func (r *PeerResolver) Resolve(peers []fab.Peer) (fab.Peer, error)

Resolve uses the MinBlockHeight resolver to choose peers but will prefer peers in the given org.

func (PeerResolver) SetLoadBalancePolicy Uses

func (p PeerResolver) SetLoadBalancePolicy(value lbp.LoadBalancePolicy)

func (*PeerResolver) ShouldDisconnect Uses

func (r *PeerResolver) ShouldDisconnect(peers []fab.Peer, connectedPeer fab.Peer) bool

ShouldDisconnect determines whether connected peer not in our org should be disconnected and reconnected to a peer in our org.

Package preferorg imports 8 packages (graph) and is imported by 2 packages. Updated 2018-11-02. Refresh now. Tools for package owners.