common

package
v0.0.0-...-d3241bd Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package common provides the deliberately small Pebble surface used by immutable collection index artifacts.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound identifies a missing key.
	ErrNotFound = pebble.ErrNotFound
	// ErrClosed identifies an operation on a closed store, batch, or iterator.
	ErrClosed = errors.New("indexstore: closed")
	// ErrReadOnly identifies a mutation attempted through a read-only store.
	ErrReadOnly = errors.New("indexstore: read-only")
)

Functions

This section is empty.

Types

type Batch

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

Batch is an atomic group of mutations.

func (*Batch) Close

func (b *Batch) Close() error

Close releases the batch. It is idempotent.

func (*Batch) Commit

func (b *Batch) Commit() error

Commit applies the batch durably. A batch can be committed once.

func (*Batch) Delete

func (b *Batch) Delete(key []byte) error

Delete adds a key deletion to the batch.

func (*Batch) Set

func (b *Batch) Set(key, value []byte) error

Set adds a key assignment to the batch.

type Iterator

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

Iterator traverses one immutable Pebble view in byte-key order.

func (*Iterator) Close

func (i *Iterator) Close() error

Close releases the iterator. It is idempotent.

func (*Iterator) Error

func (i *Iterator) Error() error

Error reports an iteration error.

func (*Iterator) First

func (i *Iterator) First() bool

First positions the iterator at its first key.

func (*Iterator) Key

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

Key returns the current key. It remains valid until the next positioning operation or Close.

func (*Iterator) Next

func (i *Iterator) Next() bool

Next advances the iterator.

func (*Iterator) Value

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

Value returns the current value. It remains valid until the next positioning operation or Close.

type Options

type Options struct {
	ReadOnly bool
}

Options controls how a Store is opened.

type PebbleLogger

type PebbleLogger struct{}

PebbleLogger discards Pebble's internal log messages.

func (PebbleLogger) Errorf

func (PebbleLogger) Errorf(string, ...interface{})

func (PebbleLogger) Fatalf

func (PebbleLogger) Fatalf(format string, args ...interface{})

func (PebbleLogger) Infof

func (PebbleLogger) Infof(string, ...interface{})

type Store

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

Store is a Pebble database rooted at one directory.

func Open

func Open(path string, options Options) (*Store, error)

Open opens or creates a Pebble store. Existing symbolic-link paths are rejected before Pebble can follow them.

func (*Store) Checkpoint

func (s *Store) Checkpoint(path string) error

Checkpoint creates a point-in-time Pebble directory at path.

func (*Store) Close

func (s *Store) Close() error

Close closes the Pebble database. It is idempotent.

func (*Store) Compact

func (s *Store) Compact(start, end []byte) error

Compact compacts the half-open key range [start, end).

func (*Store) Delete

func (s *Store) Delete(key []byte) error

Delete durably removes one key.

func (*Store) Destroy

func (s *Store) Destroy() error

Destroy closes the database and removes its exact directory. It may be called only once and is unavailable for read-only stores.

func (*Store) Flush

func (s *Store) Flush() error

Flush writes the current memtable to an SSTable.

func (*Store) Get

func (s *Store) Get(key []byte) ([]byte, error)

Get returns an owned value copy.

func (*Store) NewBatch

func (s *Store) NewBatch() *Batch

NewBatch creates a write batch owned by the store.

func (*Store) NewPrefixIterator

func (s *Store) NewPrefixIterator(prefix []byte) (*Iterator, error)

NewPrefixIterator creates an iterator over all keys beginning with prefix.

func (*Store) NewRangeIterator

func (s *Store) NewRangeIterator(lower, upper []byte) (*Iterator, error)

NewRangeIterator creates an iterator over the half-open range [lower, upper). A nil bound leaves that side of the range unbounded.

func (*Store) Set

func (s *Store) Set(key, value []byte) error

Set stores one key and value durably.

Jump to

Keyboard shortcuts

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