Documentation ¶
Index ¶
- Constants
- Variables
- func GetIndexFromFileName(name string) (int64, error)
- func MakeFileNameFromIndex(index int64) string
- type WAL
- func (l *WAL) Close() error
- func (l *WAL) CloseAndRemove() error
- func (l *WAL) Count() int
- func (l *WAL) FirstIndex() int64
- func (l *WAL) GetConfig() *WALConfig
- func (l *WAL) LastIndex() int64
- func (l *WAL) Read(index int64) (*binary.Entry, error)
- func (l *WAL) Scan(iter func(e *binary.Entry) bool) error
- func (l *WAL) String() string
- func (l *WAL) Sync() error
- func (l *WAL) TruncateFront(index int64) error
- func (l *WAL) Write(e *binary.Entry) (int64, error)
- func (l *WAL) WriteBatch(batch *binary.Batch) error
- type WALConfig
Constants ¶
View Source
const ( FilePrefix = "dat-" FileSuffix = ".seg" )
Variables ¶
View Source
var ( ErrOutOfBounds = errors.New("error: out of bounds") ErrSegmentFull = errors.New("error: segment is full") ErrFileClosed = errors.New("error: file closed") ErrBadArgument = errors.New("error: bad argument") ErrNoPathProvided = errors.New("error: no path provided") ErrOptionsMissing = errors.New("error: options missing") )
Functions ¶
func GetIndexFromFileName ¶
func MakeFileNameFromIndex ¶
Types ¶
type WAL ¶
type WAL struct {
// contains filtered or unexported fields
}
WAL is a write-ahead log structure
func (*WAL) CloseAndRemove ¶ added in v1.6.0
func (*WAL) FirstIndex ¶
FirstIndex returns the write-ahead logs first index
func (*WAL) TruncateFront ¶
TruncateFront removes all segments and entries before specified index
Click to show internal directories.
Click to hide internal directories.