Versions in this module Expand all Collapse all v0 v0.2.1 Feb 9, 2024 Changes in this version + var ErrCorruptLog = errors.New("log corrupt") + var ErrLogClosed = errors.New("log closed") + var ErrLogEntryNotFound = errors.New("not found") + var ErrLogIndexOutOfOrder = errors.New("out of order") + var ErrLogIndexOutOfRange = errors.New("out of range") + var ErrLogPathNotAbsolute = errors.New("log path is not absolute") + type Batch struct + AfterWriteAttempt func(error) + FinalizeBatch func(lastEntryIndex uint64) + FinalizeEntry func(entry []byte, absoluteIndex uint64) + func (b *Batch) Clear() + func (b *Batch) Write(index uint64, data []byte) + type Log struct + func OpenWAL(path string, fls afs.Filesystem, opts *LogOptions) (*Log, error) + func (l *Log) ClearCache() error + func (l *Log) Close() error + func (l *Log) FirstIndex() (index uint64, err error) + func (l *Log) IsClosed() bool + func (l *Log) LastIndex() (index uint64, err error) + func (l *Log) Len() (n uint64, err error) + func (l *Log) Read(index uint64) (data []byte, err error) + func (l *Log) Sync() error + func (l *Log) TruncateBack(index uint64) error + func (l *Log) TruncateFront(index uint64) error + func (l *Log) Write(index uint64, data []byte) error + func (l *Log) WriteBatch(b *Batch) (err error) + func (l *Log) WriteCall(index uint64, data []byte, fn func() error) (lastIndex uint64, _ error) + type LogOptions struct + DirPerms os.FileMode + FilePerms os.FileMode + FillID bool + NoCopy bool + NoSync bool + RecoverCorruptedTail bool + SegmentCacheSize int + SegmentSize int