fabric-sdk-go: github.com/hyperledger/fabric-sdk-go/pkg/client/common/selection/options Index | Files

package options

import "github.com/hyperledger/fabric-sdk-go/pkg/client/common/selection/options"


Package Files


func WithPeerFilter Uses

func WithPeerFilter(value PeerFilter) copts.Opt

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

func WithPeerSorter Uses

func WithPeerSorter(value PeerSorter) copts.Opt

WithPeerSorter sets a peer sorter function which provides per-request sorting of peers

func WithPrioritySelector Uses

func WithPrioritySelector(value PrioritySelector) copts.Opt

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

func WithRetryOpts Uses

func WithRetryOpts(value retry.Opts) copts.Opt

WithRetryOpts sets the retry options

type Params Uses

type Params struct {
    PeerFilter PeerFilter
    PeerSorter PeerSorter
    RetryOpts  retry.Opts

Params defines the parameters of a selection service request

func NewParams Uses

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

NewParams creates new parameters based on the provided options

func (*Params) SetPeerFilter Uses

func (p *Params) SetPeerFilter(value PeerFilter)

SetPeerFilter sets the peer filter

func (*Params) SetPeerSorter Uses

func (p *Params) SetPeerSorter(value PeerSorter)

SetPeerSorter sets the priority selector

func (*Params) SetRetryOpts Uses

func (p *Params) SetRetryOpts(value retry.Opts)

SetRetryOpts sets the priority selector

type PeerFilter Uses

type PeerFilter func(peer fab.Peer) bool

PeerFilter filters out unwanted peers

type PeerSorter Uses

type PeerSorter func(peers []fab.Peer) []fab.Peer

PeerSorter sorts the peers

type PrioritySelector Uses

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

Package options imports 5 packages (graph) and is imported by 8 packages. Updated 2018-10-10. Refresh now. Tools for package owners.