journal

package
v1.10.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package journal opens private, exclusively owned SQLite journals.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application int

Application prevents a broker from opening a worker journal or the reverse.

const (
	// Broker identifies the broker receipt/status journal.
	Broker Application = 0x43584252
	// Worker identifies the worker ownership journal.
	Worker Application = 0x4358574b
)

type Journal

type Journal struct {
	DB   *sql.DB
	Conn *sql.Conn
}

Journal keeps one connection and its exclusive lock until Close. Callers serialize their own state transitions; a second process cannot take ownership while this connection is alive. Protect the directory against owner mutation.

func Open

func Open(ctx context.Context, filename string, application Application) (*Journal, error)

Open checks the private file and synchronously acquires exclusive ownership.

func (*Journal) Close

func (j *Journal) Close() error

Close releases ownership without deleting persisted state.

Jump to

Keyboard shortcuts

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