Documentation ¶
Index ¶
Constants ¶
const ConstEntrySize = 35
ConstEntrySize is the size of the constant portion of an Entry 8 + 4 + 15 + 4 + 4 = 35
Variables ¶
var ErrConfigNotFound = errors.New("config file not found")
var ErrCrc32Mismatch = errors.New("crc32 mismatch")
var ErrFileAlreadyOpen = errors.New("file already open")
var ErrIndexAndTimestampSet = errors.New("index and timestamp cannot both be set")
var ErrNoPreviousEntry = errors.New("no previous entry")
var ErrNoSegmentsFound = errors.New("no segments found")
var ErrNotADirectory = errors.New("not a directory")
var ErrParseConfig = errors.New("error parsing config file")
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Wal)
func WithExpiration ¶
WithExpiration sets the expiration time of messages in the Wal and the interval at which to check for expired segments
func WithMaxSegmentCount ¶
WithMaxSegmentCount sets the maximum number of segments
func WithMaxSegmentSize ¶
WithMaxSegmentSize sets the maximum size of a segment in bytes
type ReaderOption ¶
func WithIndex ¶
func WithIndex(index uint64) ReaderOption
WithIndex sets the starting index of the Reader. It will try to seek to the message with that index. If it is set to before the earliest index, it will be set to the earliest index. If it is set to after the latest index, it will be set to the latest index. It will fail if the WithTimestamp option is also set.
func WithTimestamp ¶
func WithTimestamp(timestamp time.Time) ReaderOption
WithTimestamp sets the starting timestamp of the Reader. It will seek for the first message after that timestamp. If it is set to after the latest timestamp, it will be set to the latest timestamp. It will fail if the WithIndex option is also set.