wal

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled      bool          `mapstructure:"enabled"       yaml:"enabled"`
	Path         string        `mapstructure:"path"          yaml:"path"`
	SyncInterval time.Duration `mapstructure:"sync_interval" yaml:"sync_interval"` // How often to fsync WAL to disk
}

Config holds write-ahead logging configuration

func DefaultConfig

func DefaultConfig() Config

type Entry

type Entry struct {
	ID        uint64    `json:"id"`
	Slot      uint64    `json:"slot"`
	Type      EntryType `json:"type"`
	Data      []byte    `json:"data"`
	Timestamp time.Time `json:"timestamp"`
	Checksum  []byte    `json:"checksum"`
}

type EntryType

type EntryType string
const (
	EntrySlotStart   EntryType = "slot_start"
	EntrySCPStart    EntryType = "scp_start"
	EntrySCPDecision EntryType = "scp_decision"
	EntryL2Block     EntryType = "l2_block"
	EntrySuperblock  EntryType = "superblock"
	EntryRollback    EntryType = "rollback"
	EntryCheckpoint  EntryType = "checkpoint"
)

type Manager

type Manager interface {
	WriteEntry(ctx context.Context, entry *Entry) error
	ReadEntries(ctx context.Context, checkpoint uint64) ([]*Entry, error)
	Checkpoint(ctx context.Context, slot uint64) error
	Truncate(ctx context.Context, beforeSlot uint64) error
	Close() error
}

Jump to

Keyboard shortcuts

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