fabric-sdk-go: github.com/hyperledger/fabric-sdk-go/pkg/fabsdk/provider/chpvdr Index | Files

package chpvdr

import "github.com/hyperledger/fabric-sdk-go/pkg/fabsdk/provider/chpvdr"


Package Files

cachekey.go chprovider.go contextcache.go eventserviceref.go

type ChannelProvider Uses

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 Uses

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

New creates a ChannelProvider based on a context

func (*ChannelProvider) ChannelService Uses

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

ChannelService creates a ChannelService for an identity

func (*ChannelProvider) Close Uses

func (cp *ChannelProvider) Close()

Close frees resources and caches.

func (*ChannelProvider) CloseContext Uses

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

CloseContext frees resources and caches for the given context.

func (*ChannelProvider) Initialize Uses

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

Initialize sets the provider context

type ChannelService Uses

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 Uses

func (cs *ChannelService) ChannelConfig() (fab.ChannelCfg, error)

ChannelConfig returns the channel config for this channel

func (*ChannelService) Config Uses

func (cs *ChannelService) Config() (fab.ChannelConfig, error)

Config returns the Config for the named channel

func (*ChannelService) Discovery Uses

func (cs *ChannelService) Discovery() (fab.DiscoveryService, error)

Discovery returns a DiscoveryService for the given channel

func (*ChannelService) EventService Uses

func (cs *ChannelService) EventService(opts ...options.Opt) (fab.EventService, error)

EventService returns the EventService.

func (*ChannelService) Membership Uses

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 Uses

func (cs *ChannelService) Selection() (fab.SelectionService, error)

Selection returns a SelectionService for the given channel

func (*ChannelService) Transactor Uses

func (cs *ChannelService) Transactor(reqCtx reqContext.Context) (fab.Transactor, error)

Transactor returns the transactor

type EventClientRef Uses

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 Uses

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

NewEventClientRef returns a new EventClientRef

func (*EventClientRef) Close Uses

func (ref *EventClientRef) Close()

Close immediately closes the connection.

func (*EventClientRef) Closed Uses

func (ref *EventClientRef) Closed() bool

Closed returns true if the event client is closed

func (*EventClientRef) RegisterBlockEvent Uses

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

RegisterBlockEvent registers for block events.

func (*EventClientRef) RegisterChaincodeEvent Uses

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

RegisterChaincodeEvent registers for chaincode events.

func (*EventClientRef) RegisterFilteredBlockEvent Uses

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

RegisterFilteredBlockEvent registers for filtered block events.

func (*EventClientRef) RegisterTxStatusEvent Uses

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

RegisterTxStatusEvent registers for transaction status events.

func (*EventClientRef) Unregister Uses

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

Unregister removes the given registration and closes the event channel.

Package chpvdr imports 20 packages (graph) and is imported by 1 packages. Updated 2020-04-22. Refresh now. Tools for package owners.