mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 23:45:10 +00:00
Created packages for the flat file store and the processor and moved functions, variables and constants from listener.go to those packages. Encapsulated everything not used outside the packages, introduced model.go files which later might be extracted into a model package and renamed parser/parsedBlock.go to parser/block.go. Signed-off-by: Stanislav Jakuschevskij <stas@two-giants.com>
25 lines
839 B
Go
25 lines
839 B
Go
package store
|
|
|
|
// Apply writes for a given transaction to off-chain data store, ideally in a single operation for fault tolerance.
|
|
type Writer = func(data LedgerUpdate)
|
|
|
|
// Ledger update made by a specific transaction.
|
|
type LedgerUpdate struct {
|
|
BlockNumber uint64
|
|
TransactionId string
|
|
Writes []Write
|
|
}
|
|
|
|
// Description of a ledger Write that can be applied to an off-chain data store.
|
|
type Write struct {
|
|
// Channel whose ledger is being updated.
|
|
ChannelName string `json:"channelName"`
|
|
// Namespace within the ledger.
|
|
Namespace string `json:"namespace"`
|
|
// Key name within the ledger namespace.
|
|
Key string `json:"key"`
|
|
// Whether the key and associated value are being deleted.
|
|
IsDelete bool `json:"isDelete"`
|
|
// If `isDelete` is false, the Value written to the key; otherwise ignored.
|
|
Value string `json:"value"`
|
|
}
|