writeaheadlog

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: Apache-2.0, MIT Imports: 14 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL