Documentation ¶
Index ¶
- func CcCalls(ccNames ...string) []*discovery.ChaincodeCall
- func CcInterests(invocationsChains ...[]*discovery.ChaincodeCall) []*discovery.ChaincodeInterest
- type Client
- type Request
- func (req *Request) AddConfigQuery() *Request
- func (req *Request) AddEndorsersQuery(interests ...*discovery.ChaincodeInterest) (*Request, error)
- func (req *Request) AddLocalPeersQuery() *Request
- func (req *Request) AddPeersQuery(invocationChain ...*discovery.ChaincodeCall) *Request
- func (req *Request) OfChannel(ch string) *Request
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CcCalls ¶
func CcCalls(ccNames ...string) []*discovery.ChaincodeCall
CcCalls creates an array of ChaincodeCalls based of cc names, can be used in AddPeersQuery(CcCalls(...))
func CcInterests ¶
func CcInterests(invocationsChains ...[]*discovery.ChaincodeCall) []*discovery.ChaincodeInterest
CcInterests creates an array of ChaincodeInterests based of ChaincodeCalls, can be used in AddEndorsersQuery(CcInterests(CcCalls(...)))
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements a Discovery client
func (*Client) Send ¶
func (c *Client) Send(ctx context.Context, req *Request, targets ...fab.PeerConfig) ([]Response, error)
Send retrieves information about channel peers, endorsers, and MSP config from the given set of peers. A set of successful responses is returned and/or an error is returned from each of the peers that was unsuccessful (note that if more than one peer returned an error then the returned error may be cast to multi.Errors).
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request aggregates several queries inside it
func (*Request) AddConfigQuery ¶
AddConfigQuery adds to the request a config query
func (*Request) AddEndorsersQuery ¶
func (req *Request) AddEndorsersQuery(interests ...*discovery.ChaincodeInterest) (*Request, error)
AddEndorsersQuery adds to the request a query for given chaincodes interests are the chaincode interests that the client wants to query for. All interests for a given channel should be supplied in an aggregated slice
func (*Request) AddLocalPeersQuery ¶
AddLocalPeersQuery adds to the request a local peer query
func (*Request) AddPeersQuery ¶
func (req *Request) AddPeersQuery(invocationChain ...*discovery.ChaincodeCall) *Request
AddPeersQuery adds to the request a peer query
type Response ¶
type Response interface { discclient.Response Target() string }
Response extends the response from the Discovery invocation on the peer by adding the endpoint URL of the peer that was invoked.