fabric-sdk-go: github.com/hyperledger/fabric-sdk-go/pkg/fab/events/service Index | Files | Directories

package service

import "github.com/hyperledger/fabric-sdk-go/pkg/fab/events/service"

Index

Package Files

opts.go service.go

type Dispatcher Uses

type Dispatcher interface {
    // Start starts the dispatcher, i.e. the dispatcher starts listening for requests/events
    Start() error

    // EventCh is the event channel over which to communicate with the dispatcher
    EventCh() (chan<- interface{}, error)

    // LastBlockNum returns the block number of the last block for which an event was received.
    LastBlockNum() uint64
}

Dispatcher is responsible for processing registration requests and block/filtered block events.

type EventProducer Uses

type EventProducer interface {
    // Register registers the given event channel with the event producer
    // and events are sent to this channel.
    Register(eventch chan<- interface{})
}

EventProducer produces events which are dispatched to clients

type Service Uses

type Service struct {
    // contains filtered or unexported fields
}

Service allows clients to register for channel events, such as filtered block, chaincode, and transaction status events.

func New Uses

func New(dispatcher Dispatcher, opts ...options.Opt) *Service

New returns a new event service initialized with the given Dispatcher

func (*Service) Dispatcher Uses

func (s *Service) Dispatcher() Dispatcher

Dispatcher returns the event dispatcher

func (*Service) RegisterBlockEvent Uses

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

RegisterBlockEvent registers for block events. If the client is not authorized to receive block events then an error is returned.

func (*Service) RegisterChaincodeEvent Uses

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

RegisterChaincodeEvent registers for chaincode events. If the client is not authorized to receive chaincode events then an error is returned. - ccID is the chaincode ID for which events are to be received - eventFilter is the chaincode event name for which events are to be received

func (*Service) RegisterFilteredBlockEvent Uses

func (s *Service) RegisterFilteredBlockEvent() (fab.Registration, <-chan *fab.FilteredBlockEvent, error)

RegisterFilteredBlockEvent registers for filtered block events. If the client is not authorized to receive filtered block events then an error is returned.

func (*Service) RegisterTxStatusEvent Uses

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

RegisterTxStatusEvent registers for transaction status events. If the client is not authorized to receive transaction status events then an error is returned. - txID is the transaction ID for which events are to be received

func (*Service) SetEventConsumerBufferSize Uses

func (p *Service) SetEventConsumerBufferSize(value uint)

func (*Service) Start Uses

func (s *Service) Start() error

Start starts the event service

func (*Service) Stop Uses

func (s *Service) Stop()

Stop stops the event service

func (*Service) StopAndTransfer Uses

func (s *Service) StopAndTransfer() (fab.EventSnapshot, error)

StopAndTransfer stops the event service and transfers all event registrations into a snapshot.

func (*Service) Submit Uses

func (s *Service) Submit(event interface{}) error

Submit submits an event for processing

func (*Service) Transfer Uses

func (s *Service) Transfer() (fab.EventSnapshot, error)

Transfer transfers all event registrations into a snapshot.

func (*Service) Unregister Uses

func (s *Service) Unregister(reg fab.Registration)

Unregister unregisters the given registration. - reg is the registration handle that was returned from one of the RegisterXXX functions

Directories

PathSynopsis
blockfilter
blockfilter/headertypefilter
dispatcher
mocks

Package service imports 8 packages (graph) and is imported by 6 packages. Updated 2019-09-16. Refresh now. Tools for package owners.