ldb

package
v0.0.0-...-1693796 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LevelDBCursor

type LevelDBCursor struct {
	// contains filtered or unexported fields
}

LevelDBCursor is a thin wrapper around native leveldb iterators.

func (*LevelDBCursor) Close

func (c *LevelDBCursor) Close() error

Close releases associated resources.

func (*LevelDBCursor) First

func (c *LevelDBCursor) First() bool

First moves the iterator to the first key/value pair. It returns false if such a pair does not exist. Panics if the cursor is closed.

func (*LevelDBCursor) Key

func (c *LevelDBCursor) Key() (*database.Key, error)

Key returns the key of the current key/value pair, or ErrNotFound if done. Note that the key is trimmed to not include the prefix the cursor was opened with. The caller should not modify the contents of the returned slice, and its contents may change on the next call to Next.

func (*LevelDBCursor) Next

func (c *LevelDBCursor) Next() bool

Next moves the iterator to the next key/value pair. It returns whether the iterator is exhausted. Panics if the cursor is closed.

func (*LevelDBCursor) Seek

func (c *LevelDBCursor) Seek(key *database.Key) error

Seek moves the iterator to the first key/value pair whose key is greater than or equal to the given key. It returns ErrNotFound if such pair does not exist.

func (*LevelDBCursor) Value

func (c *LevelDBCursor) Value() ([]byte, error)

Value returns the value of the current key/value pair, or ErrNotFound if done. The caller should not modify the contents of the returned slice, and its contents may change on the next call to Next.

Jump to

Keyboard shortcuts

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