Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAndRecover ¶
CheckAndRecover checks and recovers the last datafile. If the datafile isn't corrupted, this is a noop. If it is, the longest non-corrupted prefix will be kept and the rest will be *deleted*. Also, the index file is also *deleted* which will be automatically recreated on next startup.
Types ¶
type Datafile ¶
type Datafile interface { FileID() int Name() string Close() error Sync() error Size() int64 Read() (internal.Entry, int64, error) ReadAt(index, size int64) (internal.Entry, error) Write(internal.Entry) (int64, int64, error) }
Datafile is an interface that represents a readable and writeable datafile
Click to show internal directories.
Click to hide internal directories.