Version: v1.0.0-alpha4 Latest Latest

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

Go to latest
Published: Jun 13, 2018 License: Apache-2.0 Imports: 3 Imported by: 0




This section is empty.


This section is empty.


func WithPeerFilter

func WithPeerFilter(value PeerFilter) copts.Opt

WithPeerFilter sets a peer filter which provides per-request filtering of peers

func WithPrioritySelector

func WithPrioritySelector(value PrioritySelector) copts.Opt

WithPrioritySelector sets a priority selector function which provides per-request prioritization of peers


type Params

type Params struct {
	PeerFilter       PeerFilter
	PrioritySelector PrioritySelector

Params defines the parameters of a selection service request

func NewParams

func NewParams(opts []copts.Opt) *Params

NewParams creates new parameters based on the provided options

func (*Params) SetPeerFilter

func (p *Params) SetPeerFilter(value PeerFilter)

SetPeerFilter sets the peer filter

func (*Params) SetPrioritySelector

func (p *Params) SetPrioritySelector(value PrioritySelector)

SetPrioritySelector sets the priority selector

type PeerFilter

type PeerFilter func(peer fab.Peer) bool

PeerFilter filters out unwanted peers

type PrioritySelector

type PrioritySelector func(peer1, peer2 fab.Peer) int

PrioritySelector determines how likely a peer is to be selected over another peer. A positive return value means peer1 is selected; negative return value means the peer2 is selected; zero return value means their priorities are the same

Source Files

Jump to

Keyboard shortcuts

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