ledger

package
v2.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LedgerManager

type LedgerManager interface {
	// Returns a LedgerReader for the passed channel, an error otherwise
	GetLedgerReader(channel string) (LedgerReader, error)
}

LedgerManager provides access to the ledger infrastructure

type LedgerReader

type LedgerReader interface {
	// GetState gets the value for given namespace and key. For a chaincode, the namespace corresponds to the chaincodeId
	GetState(namespace string, key string) ([]byte, error)

	// GetStateRangeScanIterator returns an iterator that contains all the Key-values between given Key ranges.
	// startKey is included in the results and endKey is excluded. An empty startKey refers to the first available Key
	// and an empty endKey refers to the last available Key. For scanning all the keys, both the startKey and the endKey
	// can be supplied as empty strings. However, a full scan should be used judiciously for performance reasons.
	// The returned ResultsIterator contains results of type *KV which is defined in protos/ledger/queryresult.
	GetStateRangeScanIterator(namespace string, startKey string, endKey string) (ledger.ResultsIterator, error)

	// Done releases resources occupied by the LedgerReader
	Done()
}

LedgerReader interface, used to read from a ledger.

type LedgerWriter

type LedgerWriter interface {
	LedgerReader
	// SetState sets the given value for the given namespace and key. For a chaincode, the namespace corresponds to the chaincodeId
	SetState(namespace string, key string, value []byte) error
	// DeleteState deletes the given namespace and key
	DeleteState(namespace string, key string) error
}

LedgerWriter interface, used to read from, and write to, a ledger.

type ResultsIterator

type ResultsIterator interface {
	// Next returns the next item in the result set. The `QueryResult` is expected to be nil when
	// the iterator gets exhausted
	Next() (ledger.QueryResult, error)
	// Close releases resources occupied by the iterator
	Close()
}

ResultsIterator - an iterator for query result set

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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