Documentation
¶
Index ¶
- Variables
- type Options
- type StateMate
- func (sm *StateMate[T]) Append(index T, data []byte) error
- func (sm *StateMate[T]) Close() error
- func (sm *StateMate[T]) Count() uint64
- func (sm *StateMate[T]) GetFirstIndex() T
- func (sm *StateMate[T]) GetLastIndex() T
- func (sm *StateMate[T]) IsEmpty() bool
- func (sm *StateMate[T]) Read(index T, fn func(data []byte) error) error
- func (sm *StateMate[T]) StorageStats() StorageStats
- func (sm *StateMate[T]) Truncate() error
- type StorageStats
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIndexGapsAreNotAllowed = errors.New("index gaps are not allowed")
View Source
var ErrIndexMustBeIncreasing = errors.New("index must be increasing")
View Source
var ErrNotEnoughSpace = errors.New("not enough space")
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type Options ¶
func (Options) GetMaxSize ¶ added in v0.0.6
type StateMate ¶
type StateMate[T ~uint64] struct { // contains filtered or unexported fields }
func (*StateMate[T]) GetFirstIndex ¶ added in v0.0.4
func (sm *StateMate[T]) GetFirstIndex() T
func (*StateMate[T]) GetLastIndex ¶ added in v0.0.4
func (sm *StateMate[T]) GetLastIndex() T
func (*StateMate[T]) StorageStats ¶ added in v0.0.8
func (sm *StateMate[T]) StorageStats() StorageStats
StorageStats returns the size of the data and index files. This method is useful for debugging and monitoring. The size of the data file is the number of bytes from the beginning of the first to the end of last data entry. The physical size of the data file may be larger than the data size due to pre-allocation. The size of the index file is the number of bytes from the beginning of the file to the end of the last index entry. The physical size of the index file may be larger than the index size due to pre-allocation.
Click to show internal directories.
Click to hide internal directories.