discovery

package
v0.0.0-...-95b87ed Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PrioritiesByHeight = &byHeight{}

	NoExclusion = selectionFunc(noExclusion)

	NoPriorities = &noPriorities{}
)
View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type ChannelResponse

type ChannelResponse interface {
	Config() (*discovery.ConfigResult, error)

	Peers(invocationChain ...*discovery.ChaincodeCall) ([]*Peer, error)

	Endorsers(invocationChain InvocationChain, f Filter) (Endorsers, error)
}

type Client

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

func NewClient

func NewClient(createConnection Dialer, s Signer, signerCacheSize uint) *Client

func (*Client) Send

func (c *Client) Send(ctx context.Context, req *Request, auth *discovery.AuthInfo) (Response, error)

type Dialer

type Dialer func() (*grpc.ClientConn, error)

type Endorsers

type Endorsers []*Peer

func (Endorsers) Filter

func (endorsers Endorsers) Filter(f ExclusionFilter) Endorsers

func (Endorsers) Shuffle

func (endorsers Endorsers) Shuffle() Endorsers

func (Endorsers) Sort

func (endorsers Endorsers) Sort(ps PrioritySelector) Endorsers

type ExclusionFilter

type ExclusionFilter interface {
	Exclude(Peer) bool
}

func ExcludeByHost

func ExcludeByHost(reject func(host string) bool) ExclusionFilter

func ExcludeHosts

func ExcludeHosts(endpoints ...string) ExclusionFilter

type Filter

type Filter interface {
	Filter(endorsers Endorsers) Endorsers
}

func NewFilter

func NewFilter(ps PrioritySelector, ef ExclusionFilter) Filter

type InvocationChain

type InvocationChain []*discovery.ChaincodeCall

func (InvocationChain) String

func (ic InvocationChain) String() string

func (InvocationChain) ValidateInvocationChain

func (ic InvocationChain) ValidateInvocationChain() error

type LocalResponse

type LocalResponse interface {
	Peers() ([]*Peer, error)
}

type MemoizeSigner

type MemoizeSigner struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewMemoizeSigner

func NewMemoizeSigner(signFunc Signer, maxEntries uint) *MemoizeSigner

func (*MemoizeSigner) Sign

func (ms *MemoizeSigner) Sign(msg []byte) ([]byte, error)

type Peer

type Peer struct {
	MSPID            string
	AliveMessage     *protoext.SignedGossipMessage
	StateInfoMessage *protoext.SignedGossipMessage
	Identity         []byte
}

type Priority

type Priority int

type PrioritySelector

type PrioritySelector interface {
	Compare(Peer, Peer) Priority
}

type Request

type Request struct {
	*discovery.Request
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest() *Request

func (*Request) AddConfigQuery

func (req *Request) AddConfigQuery() *Request

func (*Request) AddEndorsersQuery

func (req *Request) AddEndorsersQuery(interests ...*discovery.ChaincodeInterest) (*Request, error)

func (*Request) AddLocalPeersQuery

func (req *Request) AddLocalPeersQuery() *Request

func (*Request) AddPeersQuery

func (req *Request) AddPeersQuery(invocationChain ...*discovery.ChaincodeCall) *Request

func (*Request) OfChannel

func (req *Request) OfChannel(ch string) *Request

type Response

type Response interface {
	ForChannel(string) ChannelResponse

	ForLocal() LocalResponse
}

type Signer

type Signer func(msg []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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