Documentation ¶
Index ¶
- Constants
- func GetEnvelopeFromBlock(data []byte) (*cb.Envelope, error)
- func UnmarshalChaincodeAction(caBytes []byte) (*peer.ChaincodeAction, error)
- func UnmarshalChaincodeActionPayload(capBytes []byte) (*peer.ChaincodeActionPayload, error)
- func UnmarshalChaincodeEvents(eBytes []byte) (*peer.ChaincodeEvent, error)
- func UnmarshalChaincodeProposalPayload(bytes []byte) (*peer.ChaincodeProposalPayload, error)
- func UnmarshalChannelHeader(bytes []byte) (*cb.ChannelHeader, error)
- func UnmarshalPayload(encoded []byte) (*cb.Payload, error)
- func UnmarshalProposalResponsePayload(prpBytes []byte) (*peer.ProposalResponsePayload, error)
- func UnmarshalTransaction(txBytes []byte) (*peer.Transaction, error)
- type ActionDetail
- type BlockEventDetail
- type CCEventDetail
- type ChaincodeEvent
- type ChaincodeID
- type ChaincodeInput
- type ChaincodeResponse
- type ChaincodeResult
- type EventHandler
- type Factory
- type HandlerSettings
- type Identity
- type Listener
- type Output
- type Reply
- type Settings
- type Spec
- type TransactionDetail
- type Trigger
Constants ¶
const ( // EventBlock type for block event EventBlock = "Block" // EventFiltered type for filtered block event EventFiltered = "Filtered Block" // EventChaincode type for chaincode event EventChaincode = "Chaincode" )
Variables ¶
This section is empty.
Functions ¶
func GetEnvelopeFromBlock ¶
GetEnvelopeFromBlock gets an envelope from a block's Data field.
func UnmarshalChaincodeAction ¶
func UnmarshalChaincodeAction(caBytes []byte) (*peer.ChaincodeAction, error)
UnmarshalChaincodeAction unmarshals bytes to a ChaincodeAction
func UnmarshalChaincodeActionPayload ¶
func UnmarshalChaincodeActionPayload(capBytes []byte) (*peer.ChaincodeActionPayload, error)
UnmarshalChaincodeActionPayload unmarshals bytes to a ChaincodeActionPayload
func UnmarshalChaincodeEvents ¶
func UnmarshalChaincodeEvents(eBytes []byte) (*peer.ChaincodeEvent, error)
UnmarshalChaincodeEvents unmarshals bytes to a ChaincodeEvent
func UnmarshalChaincodeProposalPayload ¶
func UnmarshalChaincodeProposalPayload(bytes []byte) (*peer.ChaincodeProposalPayload, error)
UnmarshalChaincodeProposalPayload unmarshals bytes to a ChaincodeProposalPayload
func UnmarshalChannelHeader ¶
func UnmarshalChannelHeader(bytes []byte) (*cb.ChannelHeader, error)
UnmarshalChannelHeader unmarshals bytes to a ChannelHeader
func UnmarshalPayload ¶
UnmarshalPayload unmarshals bytes to a Payload
func UnmarshalProposalResponsePayload ¶
func UnmarshalProposalResponsePayload(prpBytes []byte) (*peer.ProposalResponsePayload, error)
UnmarshalProposalResponsePayload unmarshals bytes to a ProposalResponsePayload
func UnmarshalTransaction ¶
func UnmarshalTransaction(txBytes []byte) (*peer.Transaction, error)
UnmarshalTransaction unmarshals bytes to a Transaction
Types ¶
type ActionDetail ¶
type ActionDetail struct { Chaincode *ChaincodeID `json:"chaincode,omitempty"` Input *ChaincodeInput `json:"input,omitempty"` Result *ChaincodeResult `json:"result,omitempty"` EndorserCount int `json:"endorsers,omitempty"` }
ActionDetail contains data in a chaincode invocation
type BlockEventDetail ¶
type BlockEventDetail struct { Number uint64 `json:"block"` SourceURL string `json:"source,omitempty"` Transactions []*TransactionDetail `json:"transactions"` }
BlockEventDetail contains data in a block event
type CCEventDetail ¶
type CCEventDetail struct { BlockNumber uint64 `json:"block"` SourceURL string `json:"source,omitempty"` TxID string `json:"txId"` ChaincodeID string `json:"chaincode"` EventName string `json:"name"` Payload string `json:"payload"` }
CCEventDetail contains data in a chaincode event
type ChaincodeEvent ¶
ChaincodeEvent defines event created by a chaincode invocation
type ChaincodeID ¶
type ChaincodeID struct { Type string `json:"type,omitempty"` Name string `json:"name"` Version string `json:"version,omitempty"` }
ChaincodeID defines chaincode identity
type ChaincodeInput ¶
type ChaincodeInput struct { Function string `json:"function"` Args []string `json:"args,omitempty"` TransientMap string `json:"transient,omitempty"` }
ChaincodeInput defines input parameters of a chaincode invocation
type ChaincodeResponse ¶
type ChaincodeResponse struct { Status int32 `json:"status"` Message string `json:"message,omitempty"` Payload string `json:"payload,omitempty"` }
ChaincodeResponse defines response from a chaincode invocation
type ChaincodeResult ¶
type ChaincodeResult struct { ReadWriteCount int `json:"rwset,omitempty"` Response *ChaincodeResponse `json:"response,omitempty"` Event *ChaincodeEvent `json:"event,omitempty"` }
ChaincodeResult defines result of a chaincode invocation
type EventHandler ¶
type EventHandler func(data interface{})
EventHandler defines action on event data
type Factory ¶
type Factory struct { }
Factory to create a trigger
type HandlerSettings ¶
type HandlerSettings struct { FabricConnector map[string]interface{} `md:"connectionName,required"` EventType string `md:"eventType,required,allowed(Block,Filtered Block,Chaincode)"` ChaincodeID string `md:"chaincodeID"` EventFilter string `md:"eventFilter"` Org string `md:"org"` User string `md:"user,required"` Validation bool `md:"validation"` }
HandlerSettings of the trigger
func (*HandlerSettings) FromMap ¶
func (h *HandlerSettings) FromMap(values map[string]interface{}) error
FromMap sets handler setting values from a map
func (*HandlerSettings) ToMap ¶
func (h *HandlerSettings) ToMap() map[string]interface{}
ToMap converts handler settings to a map
type Identity ¶
type Identity struct { Mspid string `json:"mspid"` Subject string `json:"subject,omitempty"` Issuer string `json:"issuer,omitempty"` Cert string `json:"cert,omitempty"` }
Identity contains creator's mspid and certificate
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
Listener caches event listener info
func NewListener ¶
func NewListener(spec *Spec, handler EventHandler) (*Listener, error)
NewListener creates a lisenter instance
type Output ¶
type Output struct {
Data interface{} `md:"data"`
}
Output of the activity
type Spec ¶
type Spec struct { Name string NetworkConfig []byte EntityMatchers []byte OrgName string UserName string ChannelID string EventType string ChaincodeID string EventFilter string }
Spec defines client for fabric events
type TransactionDetail ¶
type TransactionDetail struct { TxType string `json:"type"` TxID string `json:"txId"` TxTime string `json:"txTime,omitempty"` ChannelID string `json:"channel"` CreatorIdentity *Identity `json:"creator,omitempty"` Actions []*ActionDetail `json:"actions,omitempty"` }
TransactionDetail contains data in a transaction
type Trigger ¶
type Trigger struct {
// contains filtered or unexported fields
}
Trigger eventlistener trigger struct
func (*Trigger) Initialize ¶
func (t *Trigger) Initialize(ctx trigger.InitContext) error
Initialize implements trigger.Trigger.Initialize