Documentation
¶
Index ¶
- Constants
- Variables
- func Encode(le *LogEntry) []byte
- type DB
- type FileLock
- type LogEntry
- type LogEntryType
- type LogFile
- func (f *LogFile) Close() error
- func (f *LogFile) FID() int
- func (f *LogFile) Load(offset int64) (*LogEntry, int, error)
- func (f *LogFile) Path() string
- func (f *LogFile) Read(offset int64, size int) (*LogEntry, error)
- func (f *LogFile) Size() (int64, error)
- func (f *LogFile) Sync() error
- func (f *LogFile) Write(offset int64, le *LogEntry) (int, error)
- type Options
Constants ¶
View Source
const (
LockFileName = "LOCK"
)
View Source
const (
LogFileNamePrefix = "log."
)
Variables ¶
View Source
var ( ErrLogFileNotExist = errors.New("log file not exist") ErrKeyNotFound = errors.New("key not found") )
View Source
var ( ErrRawSizeTooShort = errors.New("raw data size too short to decode") ErrCheckSumNotMatch = errors.New("crc check sum not match") )
Functions ¶
Types ¶
type LogEntryType ¶
type LogEntryType uint8
const ( MaxLogEntryHeaderSize = 25 Normal LogEntryType = iota + 1 Delete ExpiredAt )
Click to show internal directories.
Click to hide internal directories.