Documentation ¶
Overview ¶
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type DataEntryPrefix ¶
type DataEntryPrefix byte
DataEntryPrefix
const ( ST_STORAGE DataEntryPrefix = 0x05 //Smart contract storage key prefix // eth state ST_ETH_ACCOUNT DataEntryPrefix = 0x31 // eth account: address -> EthAccount )
type PersistStore ¶
type PersistStore interface { Get(key []byte) ([]byte, error) BatchPut(key []byte, value []byte) //Put a key-value pair to batch BatchDelete(key []byte) //Delete the key in batch NewIterator(prefix []byte) StoreIterator //Return the iterator of store }
PersistStore of ledger
type StoreIterator ¶
type StoreIterator interface { Next() bool //Next item. If item available return true, otherwise return false //Prev() bool //previous item. If item available return true, otherwise return false First() bool //First item. If item available return true, otherwise return false //Last() bool //Last item. If item available return true, otherwise return false //Seek(key []byte) bool //Seek key. If item available return true, otherwise return false Key() []byte //Return the current item key Value() []byte //Return the current item value Release() //Close iterator Error() error // Error returns any accumulated error. }
Store iterator for iterate store