Documentation
¶
Index ¶
- type WAL
- func (wal *WAL) Close() error
- func (wal *WAL) CreateCheckpoint(data []byte) error
- func (wal *WAL) Flush() error
- func (wal *WAL) ReadAllFromCurrent(fromCheckpoint bool) ([]*types.WAL_Entry, error)
- func (wal *WAL) ReadAllFromIndex(index int, fromCheckpoint bool) ([]*types.WAL_Entry, error)
- func (wal *WAL) WriteEntry(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WAL ¶
type WAL struct {
// contains filtered or unexported fields
}
func (*WAL) CreateCheckpoint ¶
creates checkpoint entry in the wal useful to restore the state of system to this point
func (*WAL) Flush ¶
writes in-memory buffer to the segment file in file system if fsync is opted, syncs file to the disk
func (*WAL) ReadAllFromCurrent ¶
reads all entries from the wal if checkpoint is true, returns all entries after that checkpoint if no checkpoint is found, empty slice is returned
func (*WAL) ReadAllFromIndex ¶
reads segment files starting from the given segment index if checkpoint is true, returns all entries after that checkpoint if no checkpoint is found, empty slice is returned
func (*WAL) WriteEntry ¶
writes entry to wal without creating checkpoint
Click to show internal directories.
Click to hide internal directories.