Versions in this module Expand all Collapse all v1 v1.0.0 Mar 20, 2022 Changes in this version + const InitialLogFileId + const MaxHeaderSize + const PathSeparator + const VLogSuffixName + const WalSuffixName + var ErrEndOfEntry = errors.New("logfile: end of entry in log file") + var ErrInvalidCrc = errors.New("logfile: invalid crc") + var ErrUnsupportedIoType = errors.New("unsupported io type") + var ErrUnsupportedLogFileType = errors.New("unsupported log file type") + var ErrWriteSizeNotEqual = errors.New("logfile: write size is not equal to entry size") + func EncodeEntry(e *LogEntry) ([]byte, int) + type EntryType byte + const TypeDelete + type FileType int8 + const ValueLog + const WAL + type IOType int8 + const FileIO + const MMap + type LogEntry struct + ExpiredAt int64 + Key []byte + Type EntryType + Value []byte + type LogFile struct + Fid uint32 + IoSelector ioselector.IOSelector + WriteAt int64 + func OpenLogFile(path string, fid uint32, fsize int64, ftype FileType, ioType IOType) (lf *LogFile, err error) + func (lf *LogFile) Close() error + func (lf *LogFile) Delete() error + func (lf *LogFile) Read(offset int64, size uint32) ([]byte, error) + func (lf *LogFile) ReadLogEntry(offset int64) (*LogEntry, int64, error) + func (lf *LogFile) Sync() error + func (lf *LogFile) Write(buf []byte) error