journal

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package journal stores capture records as an append-only wire-frame journal. A journal can be inspected after an interrupted writer and published without replacing an existing recording.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finalization

type Finalization struct {
	JournalPath    string
	Destination    string
	Session        [16]byte
	Records, Bytes uint64
}

Finalization describes the journal immediately before publication.

type FinalizeHook

type FinalizeHook func(Finalization) error

type Journal

type Journal struct {
	// contains filtered or unexported fields
}

Journal is safe for concurrent Append calls. Append is bounded by Limits; it copies no more than the supplied record payload into the kernel writer.

func Create

func Create(path string, session [16]byte, options Options) (*Journal, error)

Create opens path as a new journal. Existing files are never overwritten.

func (*Journal) Append

func (j *Journal) Append(r wire.Record) error

Append adds one record. A record from another session is rejected before touching the journal. SyncEach makes every successful append durable.

func (*Journal) Close

func (j *Journal) Close() error

Close flushes and closes the journal. It may be called more than once.

func (*Journal) Finalize

func (j *Journal) Finalize(dst string, hook FinalizeHook) error

Finalize closes the journal, runs hook, and atomically publishes it at dst. The destination is created with a link operation, so an existing recording is never replaced. If the hook or publication fails, the source is retained.

type Options

type Options struct {
	Limits   wire.Limits
	SyncEach bool
}

Options controls journal durability and ingestion bounds.

type Recovery

type Recovery struct {
	Records             []wire.Record
	Stats               wire.Stats
	Complete, Truncated bool
}

Recovery is the valid prefix and its terminal condition.

func Recover

func Recover(path string, limits wire.Limits) (Recovery, error)

Recover decodes a journal without executing or loading any captured code. A truncated final frame is recoverable and is reported with Truncated=true. Other malformed input returns the valid prefix plus an error.

Jump to

Keyboard shortcuts

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