events

package
v1.0.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2017 License: Apache-2.0 Imports: 20 Imported by: 0

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

func NewEventHub

func NewEventHub(client fc.Client) (EventHub, error)

NewEventHub ...

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

Build builds a mock chaincode event block

type MockCCEventBuilder

type MockCCEventBuilder struct {
	CCID      string
	EventName string
	Payload   []byte
}

MockCCEventBuilder builds a mock chaincode event

func (*MockCCEventBuilder) Build

Build builds a mock chaincode event

type MockTxEventBuilder

type MockTxEventBuilder struct {
	ChannelID string
	TxID      string
}

MockTxEventBuilder builds a mock TX event block

func (*MockTxEventBuilder) Build

func (b *MockTxEventBuilder) Build() *pb.Event_Block

Build builds a mock TX event block

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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