Documentation
¶
Index ¶
Constants ¶
Variables ¶
View Source
var ErrInvalidCRC = errors.New("invalid CRC checksum")
View Source
var (
ErrReadingRecord = errors.New("error reading record")
)
Functions ¶
This section is empty.
Types ¶
type WriteAheadLog ¶
type WriteAheadLog struct {
// contains filtered or unexported fields
}
func New ¶
func New(fileName string) (*WriteAheadLog, error)
New opens a write ahead log file, creating one if necessary. Call Close() on the WriteAheadLog to ensure the file is closed after use.
func (*WriteAheadLog) Append ¶
func (w *WriteAheadLog) Append(b []byte) error
Appends a record to the write ahead log Must flush the OS cache on every append to ensure consistency
func (*WriteAheadLog) Close ¶
func (w *WriteAheadLog) Close() error
func (*WriteAheadLog) ReadAll ¶
func (w *WriteAheadLog) ReadAll() ([][]byte, error)
func (*WriteAheadLog) Truncate ¶
func (w *WriteAheadLog) Truncate() error
Truncate truncates the write ahead log
Click to show internal directories.
Click to hide internal directories.