mailindex

package
v3.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 11 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 mailindex observes Mail's Envelope Index without opening a writable SQLite connection. Connections are reused, but every query releases its read transaction so a later observation can see Mail's committed changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Available

func Available() bool

func Close

func Close()

Close releases existing process-lifetime connections after in-flight observations. Later calls can open a fresh connection, including concurrent callers waiting for an observation that Close just retired.

func Query

func Query(ctx context.Context, path, sql string) ([]byte, error)

Query executes one SELECT (including WITH) on a read-only connection and returns sqlite3 -json compatible rows. SQL that can mutate the database or connection, including PRAGMA, ATTACH, and transaction control, is rejected.

func Reset

func Reset()

Reset is useful when a test changes its isolated index fixture.

Types

type Stats

type Stats struct {
	Queries         int64   `json:"queries"`
	ConnectionOpens int64   `json:"connectionOpens"`
	QueryMS         float64 `json:"queryMs"`
}

Stats counts only local observations and read-only connection opens; it contains no message, account, query text, or filesystem path information.

func Statistics

func Statistics() Stats

Jump to

Keyboard shortcuts

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