storepebble

package
v0.0.0-...-7899014 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Break = store.Break

	NewMemFS = vfs.NewMem

	ErrKeyNotFound = store.ErrKeyNotFound
	ErrClosed      = store.ErrClosed
)
View Source
var TestingIndex = testingIndex{}

Functions

func TestBatchIndex

func TestBatchIndex(
	t *testing.T,
	newStore New,
	newBatch NewBatch,
	test index.TestIndex,
	wg *pr2.WaitGroup,
)

func TestBatchKV

func TestBatchKV(
	t *testing.T,
	test storekv.TestKV,
	newStore New,
	newBatch NewBatch,
	wg *pr2.WaitGroup,
)

func TestIndex

func TestIndex(
	t *testing.T,
	newStore New,
	test index.TestIndex,
	wg *pr2.WaitGroup,
)

func TestKV

func TestKV(
	t *testing.T,
	test storekv.TestKV,
	newStore New,
	wg *pr2.WaitGroup,
)

func TestMixedIndex

func TestMixedIndex(
	t *testing.T,
	newStore New,
	testIndex index.TestIndex,
	wg *pr2.WaitGroup,
)

func TestMixedKV

func TestMixedKV(
	t *testing.T,
	newStore New,
	testKV storekv.TestKV,
	wg *pr2.WaitGroup,
)

Types

type Batch

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

func (*Batch) Abort

func (b *Batch) Abort() error

func (*Batch) Commit

func (b *Batch) Commit() (err error)

func (*Batch) CostInfo

func (b *Batch) CostInfo() storekv.CostInfo

func (*Batch) IndexFor

func (b *Batch) IndexFor(id StoreID) (index.Index, error)

func (*Batch) KeyDelete

func (b *Batch) KeyDelete(keys ...string) (err error)

func (*Batch) KeyExists

func (b *Batch) KeyExists(key string) (ok bool, err error)

func (*Batch) KeyGet

func (b *Batch) KeyGet(key string, fn func(io.Reader) error) (err error)

func (*Batch) KeyIter

func (b *Batch) KeyIter(prefix string, fn func(key string) error) (err error)

func (*Batch) KeyPut

func (b *Batch) KeyPut(key string, r io.Reader) (err error)

func (*Batch) Name

func (b *Batch) Name() string

func (*Batch) StoreID

func (b *Batch) StoreID() string

type CacheSize

type CacheSize int64

type Codec

type Codec = codec.Codec

type Def

type Def struct{}

func (Def) CacheSize

func (Def) CacheSize() (
	cacheSize CacheSize,
)

func (Def) New

func (Def) New(
	ensureDir fsys.EnsureDir,
	cacheSize CacheSize,
	setRestrictedPath fsys.SetRestrictedPath,
	machine naming.MachineName,
) New

func (Def) NewBatch

func (Def) NewBatch() NewBatch

type Index

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

func (Index) Delete

func (i Index) Delete(entry IndexEntry) (err error)

func (Index) Iter

func (idx Index) Iter(
	lower *sb.Tokens,
	upper *sb.Tokens,
	order index.Order,
) (pp.Src, io.Closer, error)

func (Index) Name

func (i Index) Name() string

func (Index) Save

func (i Index) Save(entry IndexEntry, options ...IndexSaveOption) (err error)

type IndexEntry

type IndexEntry = index.Entry

type IndexSaveOption

type IndexSaveOption = index.SaveOption

type IndexTapEntry

type IndexTapEntry = index.TapEntry

type Key

type Key = key.Key

type Logger

type Logger struct{}

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, args ...any)

func (*Logger) Infof

func (l *Logger) Infof(format string, args ...any)

type New

type New func(
	ctx context.Context,
	fs vfs.FS,
	dir string,
) (*Store, error)

create new pebble store

type NewBatch

type NewBatch func(
	ctx context.Context,
	store *Store,
) (*Batch, error)

type Prefix

type Prefix uint8
const (
	Kv Prefix = iota + 1
	Idx
)

type Store

type Store struct {
	DB *pebble.DB
	// contains filtered or unexported fields
}

func (*Store) CostInfo

func (s *Store) CostInfo() storekv.CostInfo

func (*Store) IndexFor

func (s *Store) IndexFor(id StoreID) (index.Index, error)

func (*Store) KeyDelete

func (s *Store) KeyDelete(keys ...string) (err error)

func (*Store) KeyExists

func (s *Store) KeyExists(key string) (ok bool, err error)

func (*Store) KeyGet

func (s *Store) KeyGet(key string, fn func(io.Reader) error) (err error)

func (*Store) KeyIter

func (s *Store) KeyIter(prefix string, fn func(key string) error) (err error)

func (*Store) KeyPut

func (s *Store) KeyPut(key string, r io.Reader) (err error)

func (*Store) Name

func (s *Store) Name() string

func (*Store) StoreID

func (s *Store) StoreID() string

type StoreID

type StoreID = store.ID

type StoreIndex

type StoreIndex = index.StoreIndex

Jump to

Keyboard shortcuts

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