Documentation ¶
Overview ¶
Package channel enables access to a channel on a Fabric network.
Index ¶
- type Client
- func (cc *Client) Execute(request Request, options ...RequestOption) (Response, error)
- func (cc *Client) InvokeHandler(handler invoke.Handler, request Request, options ...RequestOption) (Response, error)
- func (cc *Client) Query(request Request, options ...RequestOption) (Response, error)
- func (cc *Client) RegisterChaincodeEvent(chainCodeID string, eventFilter string) (fab.Registration, <-chan *fab.CCEvent, error)
- func (cc *Client) UnregisterChaincodeEvent(registration fab.Registration)
- type ClientOption
- type Request
- type RequestOption
- func WithParentContext(parentContext reqContext.Context) RequestOption
- func WithRetry(retryOpt retry.Opts) RequestOption
- func WithTargetFilter(filter fab.TargetFilter) RequestOption
- func WithTargetURLs(urls ...string) RequestOption
- func WithTargets(targets ...fab.Peer) RequestOption
- func WithTimeout(timeoutType core.TimeoutType, timeout time.Duration) RequestOption
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client enables access to a channel on a Fabric network.
A channel client instance provides a handler to interact with peers on specified channel. An application that requires interaction with multiple channels should create a separate instance of the channel client for each channel. Channel client supports non-admin functions only.
func New ¶
func New(channelProvider context.ChannelProvider, opts ...ClientOption) (*Client, error)
New returns a Client instance.
func (*Client) Execute ¶
func (cc *Client) Execute(request Request, options ...RequestOption) (Response, error)
Execute prepares and executes transaction using request and optional options provided
func (*Client) InvokeHandler ¶
func (cc *Client) InvokeHandler(handler invoke.Handler, request Request, options ...RequestOption) (Response, error)
InvokeHandler invokes handler using request and options provided
func (*Client) Query ¶
func (cc *Client) Query(request Request, options ...RequestOption) (Response, error)
Query chaincode using request and optional options provided
func (*Client) RegisterChaincodeEvent ¶
func (cc *Client) RegisterChaincodeEvent(chainCodeID string, eventFilter string) (fab.Registration, <-chan *fab.CCEvent, error)
RegisterChaincodeEvent registers chain code event @param {chan bool} channel which receives event details when the event is complete @returns {object} object handle that should be used to unregister
func (*Client) UnregisterChaincodeEvent ¶
func (cc *Client) UnregisterChaincodeEvent(registration fab.Registration)
UnregisterChaincodeEvent removes chain code event registration
type ClientOption ¶
ClientOption describes a functional parameter for the New constructor
type RequestOption ¶
RequestOption func for each Opts argument
func WithParentContext ¶
func WithParentContext(parentContext reqContext.Context) RequestOption
WithParentContext encapsulates grpc context parent to Options
func WithRetry ¶
func WithRetry(retryOpt retry.Opts) RequestOption
WithRetry option to configure retries
func WithTargetFilter ¶
func WithTargetFilter(filter fab.TargetFilter) RequestOption
WithTargetFilter specifies a per-request target peer-filter
func WithTargetURLs ¶
func WithTargetURLs(urls ...string) RequestOption
WithTargetURLs allows overriding of the target peers for the request. Targets are specified by URL, and the SDK will create the underlying peer objects.
func WithTargets ¶
func WithTargets(targets ...fab.Peer) RequestOption
WithTargets encapsulates ProposalProcessors to Option
func WithTimeout ¶
func WithTimeout(timeoutType core.TimeoutType, timeout time.Duration) RequestOption
WithTimeout encapsulates key value pairs of timeout type, timeout duration to Options
type Response ¶
type Response struct { Payload []byte TransactionID fab.TransactionID TxValidationCode pb.TxValidationCode Proposal *fab.TransactionProposal Responses []*fab.TransactionProposalResponse }
Response contains response parameters for query and execute an invocation transaction