Documentation ¶
Index ¶
- Constants
- Variables
- func ClearDatabase(basepath string) error
- type Batch
- type Database
- type Iterator
- type PebbleDB
- func (p *PebbleDB) Close() error
- func (p *PebbleDB) Del(key []byte) error
- func (p *PebbleDB) Flush() error
- func (p *PebbleDB) Get(key []byte) (value []byte, err error)
- func (p *PebbleDB) Has(key []byte) (exists bool, err error)
- func (p *PebbleDB) NewBatch() Batch
- func (p *PebbleDB) NewIterator() (Iterator, error)
- func (p *PebbleDB) NewPrefixIterator(prefix []byte) (Iterator, error)
- func (p *PebbleDB) Path() string
- func (p *PebbleDB) Put(key, value []byte) error
- type Reader
- type Table
- type Writer
Constants ¶
View Source
const DefaultDatabaseDir = "db"
Variables ¶
View Source
var ErrNotFound = pebble.ErrNotFound
Functions ¶
func ClearDatabase ¶
Types ¶
type Database ¶
type Database interface { Reader Writer io.Closer Path() string NewBatch() Batch NewIterator() (Iterator, error) NewPrefixIterator(prefix []byte) (Iterator, error) }
Database wraps all database operations. All methods are safe for concurrent use.
type Iterator ¶
type Iterator interface { Valid() bool Next() bool Key() []byte Value() []byte First() bool Release() SeekGE(key []byte) bool io.Closer }
Iterator iterates over key/value pairs in ascending key order. Must be released after use.
type PebbleDB ¶
type PebbleDB struct {
// contains filtered or unexported fields
}
func (*PebbleDB) NewBatch ¶
NewBatch returns an implementation of Batch interface using the internal database
func (*PebbleDB) NewIterator ¶
NewIterator returns an implementation of Iterator interface using the internal database
func (*PebbleDB) NewPrefixIterator ¶
NewPrefixIterator returns an implementation of Iterator over a specific keys that contains the prefix more info: https://github.com/ChainSafe/gossamer/pull/3434#discussion_r1291503323
Click to show internal directories.
Click to hide internal directories.