primary

package
v0.0.0-...-37434a1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: Apache-2.0, MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrimaryStorage

type PrimaryStorage interface {
	// Returns the key-value pair from the given position.
	Get(blk types.Block) (key []byte, value []byte, err error)

	// Saves a key-value pair and returns the position it was stored at.
	Put(key []byte, value []byte) (blk types.Block, err error)

	//  Creates a key that can be used for the index.
	//
	//  The index needs a key which is at least 4 bytes long and contains random bytes (the more
	//  random the better). In case the keys you are storing don't have this property, you can
	//  transform them with this function.
	//
	//  By default it just returns the original key with any changes.
	IndexKey(key []byte) ([]byte, error)

	// Returns the key that is used for the index which is stored at the given position.
	//
	// Note that this key might differ from the key that is actually stored.
	GetIndexKey(blk types.Block) ([]byte, error)

	Flush() (types.Work, error)
	Sync() error

	Close() error
	OutstandingWork() types.Work
	Iter() (PrimaryStorageIter, error)
}

PrimaryStorage is an interface for storing and retrieving key value pairs on disk

type PrimaryStorageIter

type PrimaryStorageIter interface {
	// Next should return io.EOF when done
	Next() (key []byte, value []byte, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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