chprovider

package
v0.4.33 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

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

func WithInitialBlockNum(blockNum uint64) Opt

WithInitialBlockNum initializes the event service with the given event snapshots

func WithLocalPeerURL added in v0.2.15

func WithLocalPeerURL(url string) Opt

WithLocalPeerURL sets the URL of the local peer

func WithSelectionRetryOpts added in v0.4.3

func WithSelectionRetryOpts(selectionRetryOpts retry.Opts) Opt

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

func (*Provider) Close

func (cp *Provider) Close()

Close frees resources and caches.

func (*Provider) Initialize

func (cp *Provider) Initialize(providers context.Providers) error

Initialize sets the provider context

Jump to

Keyboard shortcuts

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