wal

package
v0.0.0-...-37eefcc Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SetLog    logCommand = 0x01
	DeleteLog logCommand = 0x02
)

Functions

func InitaliseWriteAheadLog

func InitaliseWriteAheadLog(
	walDir string,
	maxLogSize int64,
	maxSegments int,
	log *zap.Logger,
	next jobstore.JobFetcher,
) (*walMiddleware, error)

InitaliseWriteAheadLog returns a instance of WAL on disk

Types

type WALReader

type WALReader interface {

	// Replay calls the function f on all the records from the offset f
	Replay(offset int64, f func([]byte) error) error

	// GetLatestOffset returns the latest offset
	GetLatestOffset() int64

	// Close safely closes the WAL. All the data is persisted in WAL before closing
	Close() error
}

WALReader reads all the changes from the disk

Jump to

Keyboard shortcuts

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