Documentation
¶
Index ¶
- type Builder
- type Iterator
- type Null
- func (n *Null) Close() error
- func (n *Null) Delete(string) error
- func (n *Null) Get(key string) ([]byte, error)
- func (n *Null) GetOffset(def int64) (int64, error)
- func (n *Null) Has(key string) (bool, error)
- func (n *Null) Iterator() (Iterator, error)
- func (n *Null) IteratorWithRange(start, limit []byte) (Iterator, error)
- func (n *Null) MarkRecovered() error
- func (n *Null) Open() error
- func (n *Null) Recovered() bool
- func (n *Null) Set(key string, val []byte) error
- func (n *Null) SetOffset(val int64) error
- type NullIter
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
Builder creates a local storage (a persistent cache) for a topic table. Builder creates one storage for each partition of the topic.
func BuilderWithOptions ¶
BuilderWithOptions builds LevelDB storage with the given options and in the given path.
func DefaultBuilder ¶
DefaultBuilder builds a LevelDB storage with default configuration. The database will be stored in the given path.
type Iterator ¶
type Iterator interface {
// Next advances the iterator to the next key.
Next() bool
// Err should be called after Next returns false to check for possible
// iteration errors.
Err() error
// Key gets the current key. If the iterator is exhausted, key will return
// nil.
Key() []byte
// Value gets the current value.
Value() ([]byte, error)
// Release releases the iterator. After release, the iterator is not usable
// anymore.
Release()
// Seek for a key in the iterator
Seek(key []byte) bool
}
Iterator provides iteration access to the stored values.
func NewMultiIterator ¶
NewMultiIterator returns an Iterator that iterates over the given subiterators. Iteration happens in lexicographical order given that the subiterators also return values in order.
type Null ¶
type Null struct {
// contains filtered or unexported fields
}
Null storage discards everything that it is given. This can be useful for debugging.
func (*Null) IteratorWithRange ¶
IteratorWithRange returns an Iterator that is immediately exhausted.
type Storage ¶
type Storage interface {
Has(string) (bool, error)
Get(string) ([]byte, error)
Set(string, []byte) error
Delete(string) error
SetOffset(value int64) error
GetOffset(defValue int64) (int64, error)
Iterator() (Iterator, error)
IteratorWithRange(start, limit []byte) (Iterator, error)
MarkRecovered() error
Recovered() bool
Open() error
Close() error
}
Storage abstracts the interface for a persistent local storage