Documentation
¶
Overview ¶
Package db owns collector SQLite lifecycle and the cross-process writer lock.
Index ¶
- Constants
- func AcquireWriterLock(ctx context.Context, path string) (func(), error)
- func CreateIfMissing(path string) (*sql.DB, bool, error)
- func Open(path string) (*sql.DB, error)
- func OpenEvidence(ctx context.Context, path string) (*sql.DB, error)
- func OpenWritable(path string) (*sql.DB, error)
- func ResetAllLocked(ctx context.Context, path string) error
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
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 ¶
CreateIfMissing publishes only a fully initialized database, without replacing an existing inode. Existing contracts are inspected read-only before writing.
func OpenEvidence ¶ added in v0.1.5
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.