Version: v1.0.0 Latest Latest

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 20 Imported by: 19




This section is empty.


This section is empty.


This section is empty.


type ChannelProvider

type ChannelProvider struct {
	// contains filtered or unexported fields

ChannelProvider keeps context across ChannelService instances.

TODO: add listener for channel config changes. Upon channel config change, underlying channel services need to recreate their channel clients.

func New

func New(config fab.EndpointConfig, opts ...options.Opt) (*ChannelProvider, error)

New creates a ChannelProvider based on a context

func (*ChannelProvider) ChannelService

func (cp *ChannelProvider) ChannelService(ctx fab.ClientContext, channelID string) (fab.ChannelService, error)

ChannelService creates a ChannelService for an identity

func (*ChannelProvider) Close

func (cp *ChannelProvider) Close()

Close frees resources and caches.

func (*ChannelProvider) CloseContext

func (cp *ChannelProvider) CloseContext(ctx fab.ClientContext)

CloseContext frees resources and caches for the given context.

func (*ChannelProvider) Initialize

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

Initialize sets the provider context

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 EventService.

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

type EventClientRef

type EventClientRef struct {
	// contains filtered or unexported fields

EventClientRef holds a reference to the event client and manages its lifecycle. When the idle timeout has been reached then the event client is closed. The next time the event client ref is accessed, a new event client is created. The EventClientRef implements all of the functions of fab.EventService, so the EventClientRef may be used wherever an EventService is required.

func NewEventClientRef

func NewEventClientRef(idleTimeout time.Duration, evtClientProvider eventClientProvider) *EventClientRef

NewEventClientRef returns a new EventClientRef

func (*EventClientRef) Close

func (ref *EventClientRef) Close()

Close immediately closes the connection.

func (*EventClientRef) Closed

func (ref *EventClientRef) Closed() bool

Closed returns true if the event client is closed

func (*EventClientRef) RegisterBlockEvent

func (ref *EventClientRef) RegisterBlockEvent(filter ...fab.BlockFilter) (fab.Registration, <-chan *fab.BlockEvent, error)

RegisterBlockEvent registers for block events.

func (*EventClientRef) RegisterChaincodeEvent

func (ref *EventClientRef) RegisterChaincodeEvent(ccID, eventFilter string) (fab.Registration, <-chan *fab.CCEvent, error)

RegisterChaincodeEvent registers for chaincode events.

func (*EventClientRef) RegisterFilteredBlockEvent

func (ref *EventClientRef) RegisterFilteredBlockEvent() (fab.Registration, <-chan *fab.FilteredBlockEvent, error)

RegisterFilteredBlockEvent registers for filtered block events.

func (*EventClientRef) RegisterTxStatusEvent

func (ref *EventClientRef) RegisterTxStatusEvent(txID string) (fab.Registration, <-chan *fab.TxStatusEvent, error)

RegisterTxStatusEvent registers for transaction status events.

func (*EventClientRef) Unregister

func (ref *EventClientRef) Unregister(reg fab.Registration)

Unregister removes the given registration and closes the event channel.

Jump to

Keyboard shortcuts

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