subs

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockHandler

type BlockHandler func(block *common.Block) bool

BlockHandler when block == nil is eq EOF and signal for terminate all sub channels

type BlockSubscription

type BlockSubscription struct {
	ErrorCloser
	// contains filtered or unexported fields
}

func NewBlockSubscription

func NewBlockSubscription() *BlockSubscription

func (*BlockSubscription) Blocks

func (b *BlockSubscription) Blocks() <-chan *common.Block

func (*BlockSubscription) Handler

func (b *BlockSubscription) Handler(block *common.Block) bool

func (*BlockSubscription) Serve

func (b *BlockSubscription) Serve(base ErrorCloser, readyForHandling ReadyForHandling) *BlockSubscription

type ErrorCloser

type ErrorCloser interface {
	Done() <-chan struct{}
	Err() <-chan error
	Errors() chan error
	Close() error
}

type EventSubscription

type EventSubscription struct {
	ErrorCloser
	// contains filtered or unexported fields
}

func NewEventSubscription

func NewEventSubscription(cid string, fromTx api.ChaincodeTx) *EventSubscription

func (*EventSubscription) Events

func (e *EventSubscription) Events() chan *peer.ChaincodeEvent

func (*EventSubscription) Handler

func (e *EventSubscription) Handler(block *common.Block) bool

func (*EventSubscription) Serve

func (e *EventSubscription) Serve(base ErrorCloser, readyForHandling ReadyForHandling) *EventSubscription

type ReadyForHandling

type ReadyForHandling func()

type TxSubscription

type TxSubscription struct {
	ErrorCloser
	// contains filtered or unexported fields
}

func NewTxSubscription

func NewTxSubscription(txId api.ChaincodeTx) *TxSubscription

func (*TxSubscription) Handler

func (ts *TxSubscription) Handler(block *common.Block) bool

func (*TxSubscription) Result

func (ts *TxSubscription) Result() (peer.TxValidationCode, error)

func (*TxSubscription) Serve

func (ts *TxSubscription) Serve(sub ErrorCloser, readyForHandling ReadyForHandling) *TxSubscription

Jump to

Keyboard shortcuts

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