Help us shape the future of Go! Take the 2026 Go Developer Survey

db

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package db owns collector SQLite lifecycle and the cross-process writer lock.

Index

Constants

View Source
const CollectorApplicationID = 1414091587
View Source
const SupportedSchemaVersion = 20
View Source
const TableEvidenceBatches = "evidence_batches"
View Source
const TableEvidenceDestinations = "evidence_destinations"
View Source
const TableEvidenceOutbox = "evidence_outbox"
View Source
const TableEvidenceQuarantine = "evidence_quarantine"
View Source
const TableEvidenceSources = "evidence_sources"
View Source
const TableEvidenceState = "evidence_state"
View Source
const WriterLockTimeout = 30 * time.Second

Variables

This section is empty.

Functions

func AcquireWriterLock added in v0.0.6

func AcquireWriterLock(ctx context.Context, path string) (func(), error)

AcquireWriterLock serializes writers across processes. Callers must not nest acquisitions. The persistent sidecar must never be removed: flock locks its inode, and the kernel releases it when the owning process exits.

func CreateIfMissing

func CreateIfMissing(path string) (*sql.DB, bool, error)

CreateIfMissing publishes only a fully initialized database, without replacing an existing inode. Existing contracts are inspected read-only before writing.

func Open

func Open(path string) (*sql.DB, error)

func OpenEvidence added in v0.1.5

func OpenEvidence(ctx context.Context, path string) (*sql.DB, error)

func OpenWritable

func OpenWritable(path string) (*sql.DB, error)

func ResetAllLocked added in v0.1.5

func ResetAllLocked(ctx context.Context, path string) error

ResetAllLocked is used by the controlled development fixture command. The caller owns the writer lock; unpublished evidence is never discarded.

Types

This section is empty.

Jump to

Keyboard shortcuts

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