Documentation
¶
Overview ¶
Package wal provides a simple interface for a write-ahead-log built on top of LevelDB
Index ¶
- Variables
- type WAL
- func (wal *WAL) Close() error
- func (wal *WAL) Delete(key string) error
- func (wal *WAL) Entries() iter.Seq2[string, []byte]
- func (wal *WAL) EntriesBetween(start, end string) iter.Seq2[string, []byte]
- func (wal *WAL) EntriesWithPrefix(prefix string) iter.Seq2[string, []byte]
- func (wal *WAL) Get(key string) ([]byte, error)
- func (wal *WAL) Put(key string, value []byte) error
- func (wal *WAL) PutBatch(entries map[string][]byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrKeyNotFound = errors.New("key not found")
)
Functions ¶
This section is empty.
Types ¶
type WAL ¶
type WAL struct {
// contains filtered or unexported fields
}
WAL provides a write-ahead-log built over LevelDB
func New ¶
New initializes a new WAL service with a LevelDB created at the given dir path. It is an error if the dir path already exists.
func (*WAL) Entries ¶
Entries returns an iterator that can be used in range loops to iterate over all entries of the WAL.
func (*WAL) EntriesBetween ¶
EntriesBetween returns an iterator that returns entries between the given set of keys. It is an open interval - the returned entries include the key 'start' and upto, but excluding the key 'end'.
func (*WAL) EntriesWithPrefix ¶
EntriesWithPrefix returns an iterator that returns entries that match the given prefix.
Click to show internal directories.
Click to hide internal directories.