Documentation ¶
Index ¶
- type ChannelService
- func (cs *ChannelService) ChannelConfig() (fab.ChannelCfg, error)
- func (cs *ChannelService) Config() (fab.ChannelConfig, error)
- func (cs *ChannelService) Discovery() (fab.DiscoveryService, error)
- func (cs *ChannelService) EventService(opts ...options.Opt) (fab.EventService, error)
- func (cs *ChannelService) Membership() (fab.ChannelMembership, error)
- func (cs *ChannelService) Selection() (fab.SelectionService, error)
- func (cs *ChannelService) Transactor(reqCtx reqContext.Context) (fab.Transactor, error)
- func (cs *ChannelService) TransferEventRegistrations() (fab.EventSnapshot, error)
- type EventClientRef
- func (ref *EventClientRef) Close()
- func (ref *EventClientRef) RegisterBlockEvent(filter ...fab.BlockFilter) (fab.Registration, <-chan *fab.BlockEvent, error)
- func (ref *EventClientRef) RegisterChaincodeEvent(ccID, eventFilter string) (fab.Registration, <-chan *fab.CCEvent, error)
- func (ref *EventClientRef) RegisterFilteredBlockEvent() (fab.Registration, <-chan *fab.FilteredBlockEvent, error)
- func (ref *EventClientRef) RegisterTxStatusEvent(txID string) (fab.Registration, <-chan *fab.TxStatusEvent, error)
- func (ref *EventClientRef) Unregister(reg fab.Registration)
- type Opt
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelService ¶
type ChannelService struct {
// contains filtered or unexported fields
}
ChannelService provides Channel clients and maintains contexts for them. the identity context is used
func (*ChannelService) ChannelConfig ¶
func (cs *ChannelService) ChannelConfig() (fab.ChannelCfg, error)
ChannelConfig returns the channel config for this channel
func (*ChannelService) Config ¶
func (cs *ChannelService) Config() (fab.ChannelConfig, error)
Config returns the Config for the named channel
func (*ChannelService) Discovery ¶
func (cs *ChannelService) Discovery() (fab.DiscoveryService, error)
Discovery returns a DiscoveryService for the given channel
func (*ChannelService) EventService ¶
func (cs *ChannelService) EventService(opts ...options.Opt) (fab.EventService, error)
EventService returns the Event Service.
func (*ChannelService) Membership ¶
func (cs *ChannelService) Membership() (fab.ChannelMembership, error)
Membership returns and caches a channel member identifier A membership reference is returned that refreshes with the configured interval
func (*ChannelService) Selection ¶
func (cs *ChannelService) Selection() (fab.SelectionService, error)
Selection returns a SelectionService for the given channel
func (*ChannelService) Transactor ¶
func (cs *ChannelService) Transactor(reqCtx reqContext.Context) (fab.Transactor, error)
Transactor returns the transactor
func (*ChannelService) TransferEventRegistrations ¶ added in v0.2.6
func (cs *ChannelService) TransferEventRegistrations() (fab.EventSnapshot, error)
TransferEventRegistrations transfers all event registrations into the returned snapshot
type EventClientRef ¶ added in v0.2.6
type EventClientRef struct {
// contains filtered or unexported fields
}
EventClientRef holds a reference to the event client and manages its lifecycle. The EventClientRef implements all of the functions of fab.EventService, so the EventClientRef may be used wherever an EventService is required.
func NewEventClientRef ¶ added in v0.2.6
func NewEventClientRef(evtClientProvider eventClientProvider) *EventClientRef
NewEventClientRef returns a new EventClientRef
func (*EventClientRef) Close ¶ added in v0.2.6
func (ref *EventClientRef) Close()
Close immediately closes the connection.
func (*EventClientRef) RegisterBlockEvent ¶ added in v0.2.6
func (ref *EventClientRef) RegisterBlockEvent(filter ...fab.BlockFilter) (fab.Registration, <-chan *fab.BlockEvent, error)
RegisterBlockEvent registers for block events.
func (*EventClientRef) RegisterChaincodeEvent ¶ added in v0.2.6
func (ref *EventClientRef) RegisterChaincodeEvent(ccID, eventFilter string) (fab.Registration, <-chan *fab.CCEvent, error)
RegisterChaincodeEvent registers for chaincode events.
func (*EventClientRef) RegisterFilteredBlockEvent ¶ added in v0.2.6
func (ref *EventClientRef) RegisterFilteredBlockEvent() (fab.Registration, <-chan *fab.FilteredBlockEvent, error)
RegisterFilteredBlockEvent registers for filtered block events.
func (*EventClientRef) RegisterTxStatusEvent ¶ added in v0.2.6
func (ref *EventClientRef) RegisterTxStatusEvent(txID string) (fab.Registration, <-chan *fab.TxStatusEvent, error)
RegisterTxStatusEvent registers for transaction status events.
func (*EventClientRef) Unregister ¶ added in v0.2.6
func (ref *EventClientRef) Unregister(reg fab.Registration)
Unregister removes the given registration and closes the event channel.
type Opt ¶ added in v0.2.6
type Opt func(*params)
Opt is a provider option
func WithBlockEvents ¶ added in v0.4.3
func WithBlockEvents() Opt
WithBlockEvents enables block events (as opposed to filtered block events)
func WithEventSnapshots ¶ added in v0.2.6
func WithEventSnapshots(snapshots map[string]fab.EventSnapshot) Opt
WithEventSnapshots initializes the event service with the given event snapshots
func WithInitialBlockNum ¶ added in v0.2.15
WithInitialBlockNum initializes the event service with the given event snapshots
func WithLocalPeerURL ¶ added in v0.2.15
WithLocalPeerURL sets the URL of the local peer
func WithSelectionRetryOpts ¶ added in v0.4.3
WithSelectionRetryOpts initializes the retry opts for selection
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements a ChannelProvider that uses a dynamic discovery provider based on the local Membership Snap, dynamic selection provider, and the local Event Snap
func New ¶
func New(config fab.EndpointConfig, opts ...Opt) (*Provider, error)
New creates a new Provider
func (*Provider) ChannelService ¶
func (cp *Provider) ChannelService(ctx fab.ClientContext, channelID string) (fab.ChannelService, error)
ChannelService creates a ChannelService for an identity