Documentation
¶
Overview ¶
Package storage implements the local segment log backing stream persistence: append-only segment files with a sparse in-memory index, plus retention-aware pruning.
Index ¶
- Variables
- type Log
- func (l *Log) Append(msg protocol.Message) (uint64, error)
- func (l *Log) Bytes() int64
- func (l *Log) BytesLocked() int64
- func (l *Log) Close() error
- func (l *Log) DeleteBefore(keepFrom uint64) error
- func (l *Log) FirstSeq() uint64
- func (l *Log) LastSeq() uint64
- func (l *Log) Read(fromSeq, max uint64) ([]Record, error)
- func (l *Log) Sync() error
- func (l *Log) TrimOverBytes(target int64) (int64, error)
- type Options
- type Record
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOutOfRange = errors.New("storage: sequence out of range")
ErrOutOfRange is returned when reading before the first or after the last available sequence.
Functions ¶
This section is empty.
Types ¶
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
Log is a sequence of segments covering a contiguous seq range.
func (*Log) BytesLocked ¶
func (*Log) DeleteBefore ¶
DeleteBefore removes every record with seq < keepFrom by dropping whole segments. Segments partially inside the range keep all records (the tail segment is never split).
Click to show internal directories.
Click to hide internal directories.