{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package ledger\n\n## Types\n\n```go\ntype LedgerManager interface {\n\t// Returns a LedgerReader for the passed channel, an error otherwise\n\tGetLedgerReader(channel string) (LedgerReader, error)\n}\n```\nLedgerManager provides access to the ledger infrastructure\n\n```go\ntype LedgerReader interface {\n\t// GetState gets the value for given namespace and key. For a chaincode, the namespace corresponds to the chaincodeId\n\tGetState(namespace string, key string) ([]byte, error)\n\n\t// GetStateRangeScanIterator returns an iterator that contains all the Key-values between given Key ranges.\n\t// startKey is included in the results and endKey is excluded. An empty startKey refers to the first available Key\n\t// and an empty endKey refers to the last available Key. For scanning all the keys, both the startKey and the endKey\n\t// can be supplied as empty strings. However, a full scan should be used judiciously for performance reasons.\n\t// The returned ResultsIterator contains results of type *KV which is defined in protos/ledger/queryresult.\n\tGetStateRangeScanIterator(namespace string, startKey string, endKey string) (ledger.ResultsIterator, error)\n\n\t// Done releases resources occupied by the LedgerReader\n\tDone()\n}\n```\nLedgerReader interface, used to read from a ledger.\n\n```go\ntype LedgerWriter interface {\n\tLedgerReader\n\t// SetState sets the given value for the given namespace and key. For a chaincode, the namespace corresponds to the chaincodeId\n\tSetState(namespace string, key string, value []byte) error\n}\n```\nLedgerWriter interface, used to read from, and write to, a ledger.\n\n```go\ntype ResultsIterator interface {\n\t// Next returns the next item in the result set. The `QueryResult` is expected to be nil when\n\t// the iterator gets exhausted\n\tNext() (ledger.QueryResult, error)\n\t// Close releases resources occupied by the iterator\n\tClose()\n}\n```\nResultsIterator - an iterator for query result set\n\n","path":"github.com/eric-erki/https-hyperledger.org/token/ledger","name":"ledger","synopsis":"","isRedistributable":true}
