leveldb

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

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

func (*Batch) Commit

func (b *Batch) Commit() error

func (*Batch) Delete

func (b *Batch) Delete(key driver.Key) error

func (*Batch) Put

func (b *Batch) Put(key driver.Key, value driver.Value) error

type Configuration

type Configuration opt.Options

func (*Configuration) Options

func (c *Configuration) Options(opts ...driver.Option) map[string]struct{}

func (*Configuration) SetBlockCacheCapacity

func (c *Configuration) SetBlockCacheCapacity(n int) driver.Option

SetBlockCacheCapacity defines the block cache capacity.

func (*Configuration) SetBlockSize

func (c *Configuration) SetBlockSize(n int) driver.Option

SetBlockSize defines the minimum uncompressed size of each sorted table.

func (*Configuration) SetCompactionTableSize

func (c *Configuration) SetCompactionTableSize(n int) driver.Option

SetCompactionTableSize limits size of sorted table.

func (*Configuration) SetCompactionTotalSize

func (c *Configuration) SetCompactionTotalSize(n int) driver.Option

SetCompactionTotalSize limits total size of sorted table for each level.

func (*Configuration) SetDisableSeeksCompaction

func (c *Configuration) SetDisableSeeksCompaction(b bool) driver.Option

SetDisableSeeksCompaction toggles the seek driven compactions feature on leveldb.

func (*Configuration) SetNoSync

func (c *Configuration) SetNoSync(b bool) driver.Option

SetNoSync allows completely disable fsync on leveldb.

func (*Configuration) SetOpenFilesCacheCapacity

func (c *Configuration) SetOpenFilesCacheCapacity(n int) driver.Option

SetOpenFilesCacheCapacity defines the upper bound of open files that the localstore should maintain at any point of time.

func (*Configuration) SetWriteBuffer

func (c *Configuration) SetWriteBuffer(n int) driver.Option

SetWriteBuffer defines the size of writer buffer.

type Driver

type Driver struct{}

Driver is exported to make the driver directly accessible. In general the driver is used via the shed/driver package.

func (Driver) Open

func (d Driver) Open(path, options string) (driver.DB, error)

type Iterator

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

func (*Iterator) Close

func (i *Iterator) Close() error

func (*Iterator) Error

func (i *Iterator) Error() error

func (*Iterator) Key

func (i *Iterator) Key() []byte

func (*Iterator) Last

func (i *Iterator) Last() bool

func (*Iterator) Next

func (i *Iterator) Next() bool

func (*Iterator) Prev

func (i *Iterator) Prev() bool

func (*Iterator) Seek

func (i *Iterator) Seek(key driver.Key) bool

func (*Iterator) Valid

func (i *Iterator) Valid() bool

func (*Iterator) Value

func (i *Iterator) Value() []byte

type LevelDB

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

func (*LevelDB) Close

func (l *LevelDB) Close() error

func (*LevelDB) CreateField

func (l *LevelDB) CreateField(spec driver.FieldSpec) ([]byte, error)

func (*LevelDB) CreateIndex

func (l *LevelDB) CreateIndex(spec driver.IndexSpec) ([]byte, error)

func (*LevelDB) DefaultFieldKey

func (l *LevelDB) DefaultFieldKey() []byte

func (*LevelDB) DefaultIndexKey

func (l *LevelDB) DefaultIndexKey() []byte

func (*LevelDB) Delete

func (l *LevelDB) Delete(key driver.Key) error

func (*LevelDB) Get

func (l *LevelDB) Get(key driver.Key) ([]byte, error)

func (*LevelDB) GetSchemaSpec

func (l *LevelDB) GetSchemaSpec() (driver.SchemaSpec, error)

func (*LevelDB) GetSnapshot

func (l *LevelDB) GetSnapshot() (driver.Snapshot, error)

func (*LevelDB) Has

func (l *LevelDB) Has(key driver.Key) (bool, error)

func (*LevelDB) InitSchema

func (l *LevelDB) InitSchema() error

func (*LevelDB) NewBatch

func (l *LevelDB) NewBatch() driver.Batching

func (*LevelDB) Put

func (l *LevelDB) Put(key driver.Key, value driver.Value) error

func (*LevelDB) RenameIndex

func (l *LevelDB) RenameIndex(oldName, newName string) (bool, error)

func (*LevelDB) Search

func (l *LevelDB) Search(query driver.Query) driver.Cursor

type Snapshot

type Snapshot struct {
	*leveldb.Snapshot
}

func (*Snapshot) Close

func (s *Snapshot) Close() error

func (*Snapshot) Get

func (s *Snapshot) Get(key driver.Key) (data []byte, err error)

func (*Snapshot) Has

func (s *Snapshot) Has(key driver.Key) (has bool, err error)

Jump to

Keyboard shortcuts

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