Versions in this module Expand all Collapse all v0 v0.1.1 Jul 7, 2023 v0.1.0 Jul 2, 2023 Changes in this version + const DataFileNameSuffix + const HintFileName + const MergedFileName + const TranNoFileName + var ErrInvalidCRC = errors.New("invalid CRC value. Maybe the log record was corrupted") + func DecodeKey(key []byte) ([]byte, uint64) + func EncodeKey(key []byte, tranNo uint64) []byte + func EncodeLogRecord(lr *LogRecord) ([]byte, int64) + func EncodeLogRecordPosition(lrp *LogRecordPosition) []byte + func GetDataFilePath(directory string, fileID uint32) string + func WriteHintRecord(hintFile *DataFile, key []byte, lrp *LogRecordPosition) error + type DataFile struct + FileID uint32 + WriteOffset int64 + func OpenDataFile(directory string, fileID uint32, ioHandlerType io_handler.IOHandlerType) (*DataFile, error) + func OpenHintFile(directory string) (*DataFile, error) + func OpenMergedFile(directory string) (*DataFile, error) + func OpenTranNoFile(directory string) (*DataFile, error) + func (df *DataFile) Close() error + func (df *DataFile) Path() string + func (df *DataFile) ReadLogRecord(offset int64) (*LogRecord, int64, error) + func (df *DataFile) SetIOHandler(ioHandlerType io_handler.IOHandlerType) error + func (df *DataFile) Size() (int64, error) + func (df *DataFile) Sync() error + func (df *DataFile) Write(data []byte) error + type LogRecord struct + Key []byte + Type LogRecordType + Value []byte + type LogRecordPosition struct + FileID uint32 + Offset int64 + Size uint32 + func DecodeLogRecordPosition(buffer []byte) *LogRecordPosition + type LogRecordType = byte + const DeletedLogRecord + const NormalLogRecord + const TransactionFinishedLogRecord + type TransactionRecord struct + Log *LogRecord + Position *LogRecordPosition