Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoResults is returned when no results have been found (e.g., in a seek) ErrNoResults = errors.New("could not find any results") )
Functions ¶
func BytesToUint64 ¶
func NewDiskStorage ¶
func NewDiskStorage(dataPath string) *diskStorage
func Uint64ToBytes ¶
Types ¶
type Storage ¶
type Storage interface { Set(key []byte, value []byte) error Get(key []byte) ([]byte, error) Increment(key []byte) (uint64, error) SetBatch(batch []KeyValue) error Contains(key []byte) bool GetFirst(count int) ([][]byte, error) GetRange(from []byte, to []byte) ([][]byte, error) TotalCount() (uint64, error) CountRange(from []byte, to []byte) (uint64, error) Iterate(prefix []byte, f func([]byte, func() ([]byte, error)) (bool, error)) error IterateReverse(prefix []byte, f func([]byte, func() ([]byte, error)) (bool, error)) error Seek(key []byte) (KeyValue, error) CountPrefix(prefix []byte) (uint64, error) Close() }
type StorageGenerator ¶
func NewDiskStorageGenerator ¶
func NewDiskStorageGenerator() StorageGenerator
Click to show internal directories.
Click to hide internal directories.