storageheadroom

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package storageheadroom preserves an advisory margin for SQLite control and terminal records by refusing payload writes before available space is spent.

Index

Constants

View Source
const DefaultReserveBytes int64 = 16 << 20

Variables

View Source
var ErrLowSpace = errors.New("storage control reserve reached")

Functions

func Check

func Check(ctx context.Context, q Queryer, reserve, payload int64) error

Types

type Queryer

type Queryer interface {
	QueryRowContext(context.Context, string, ...any) *sql.Row
	QueryContext(context.Context, string, ...any) (*sql.Rows, error)
}

Queryer is satisfied by a transaction or its owned connection. Call Check within the payload writer's existing serialization, before its first write.

Jump to

Keyboard shortcuts

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