Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry interface { WALEpoch() uint64 cbg.CBORMarshaler cbg.CBORUnmarshaler }
type WriteAheadLog ¶
type WriteAheadLog[T any, PT interface { *T Entry }] struct { // contains filtered or unexported fields }
func Open ¶
func Open[T any, PT interface { *T Entry }](directory string) (*WriteAheadLog[T, PT], error)
func (*WriteAheadLog[T, PT]) All ¶
func (wal *WriteAheadLog[T, PT]) All() ([]T, error)
func (*WriteAheadLog[T, PT]) Append ¶
func (wal *WriteAheadLog[T, PT]) Append(value T) error
func (*WriteAheadLog[T, PT]) Close ¶
func (wal *WriteAheadLog[T, PT]) Close() error
Close closes the existing file the WAL is safe to discard or can be used still
func (*WriteAheadLog[T, PT]) Purge ¶
func (wal *WriteAheadLog[T, PT]) Purge(keepEpoch uint64) error
Purge removes files containing entries only older than keepEpoch It is not guaranteed to remove all entries older than keepEpoch as it will keep the current file.
func (*WriteAheadLog[T, PT]) Rotate ¶
func (wal *WriteAheadLog[T, PT]) Rotate() error
Rotate closes the existing file
Click to show internal directories.
Click to hide internal directories.