Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainCodeCBE ¶
type ChainCodeCBE struct {
// chaincode id
CCID string
// event name regex filter
EventNameFilter string
// callback function to invoke on successful filter match
CallbackFunc func(*ChaincodeEvent)
}
ChainCodeCBE ... *
- The ChainCodeCBE is used internal to the EventHub to hold chaincode
- event registration callbacks.
type ChaincodeEvent ¶
type ChaincodeEvent struct {
ChaincodeID string
TxID string
EventName string
Payload []byte
ChannelID string
}
ChaincodeEvent contains the current event data for the event handler
type EventHub ¶
type EventHub interface {
SetPeerAddr(peerURL string, certificate string, serverHostOverride string)
IsConnected() bool
Connect() error
Disconnect()
RegisterChaincodeEvent(ccid string, eventname string, callback func(*ChaincodeEvent)) *ChainCodeCBE
UnregisterChaincodeEvent(cbe *ChainCodeCBE)
RegisterTxEvent(txID string, callback func(string, pb.TxValidationCode, error))
UnregisterTxEvent(txID string)
RegisterBlockEvent(callback func(*common.Block))
UnregisterBlockEvent(callback func(*common.Block))
}
EventHub ...
type EventHubExt ¶
type EventHubExt interface {
SetInterests(block bool)
}
The EventHubExt interface allows extensions of the SDK to add functionality to EventHub overloads.
type MockCCBlockEventBuilder ¶
type MockCCBlockEventBuilder struct {
CCID string
EventName string
ChannelID string
TxID string
Payload []byte
}
MockCCBlockEventBuilder builds a mock CC event block
func (*MockCCBlockEventBuilder) Build ¶
func (b *MockCCBlockEventBuilder) Build() *pb.Event_Block
Build builds a mock chaincode event block
type MockCCEventBuilder ¶
MockCCEventBuilder builds a mock chaincode event
func (*MockCCEventBuilder) Build ¶
func (b *MockCCEventBuilder) Build() *pb.Event_ChaincodeEvent
Build builds a mock chaincode event
type MockTxEventBuilder ¶
MockTxEventBuilder builds a mock TX event block
func (*MockTxEventBuilder) Build ¶
func (b *MockTxEventBuilder) Build() *pb.Event_Block
Build builds a mock TX event block
Click to show internal directories.
Click to hide internal directories.