Documentation
¶
Overview ¶
Package syncaudit bridges the git sync layer to the SQLite store. It is the single place that implements git.Recorder, keeping internal/git free of any store import (AGENTS.md: engines depend on interfaces; only internal/store touches SQLite). git defines the Recorder interface; this package wires it to the store's sync_audit / sync_queue tables and freshness timestamps.
Index ¶
- type Recorder
- func (r *Recorder) Enqueue(repoKey, branch, commitSHA string, ev gitpkg.AuditEvent)
- func (r *Recorder) LastFetch(repoKey string) (int64, bool)
- func (r *Recorder) MarkQueued(id int64, status, detail string)
- func (r *Recorder) Pending(repoKey string) []gitpkg.QueuedItem
- func (r *Recorder) Record(ev gitpkg.AuditEvent)
- func (r *Recorder) ResolveQueued(id int64)
- func (r *Recorder) SetLastFetch(repoKey string, seconds int64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder implements git.Recorder against a *store.DB.
func New ¶
New returns a store-backed recorder, or nil if db is nil (callers treat a nil recorder as "no audit", matching git's noop default).
func (*Recorder) Enqueue ¶
func (r *Recorder) Enqueue(repoKey, branch, commitSHA string, ev gitpkg.AuditEvent)
Enqueue records a committed-but-unpushed operation and audits the deferral.
func (*Recorder) MarkQueued ¶
MarkQueued flags a queued item (e.g. needs-resolution).
func (*Recorder) Pending ¶
func (r *Recorder) Pending(repoKey string) []gitpkg.QueuedItem
Pending returns flushable queued items, oldest first.
func (*Recorder) Record ¶
func (r *Recorder) Record(ev gitpkg.AuditEvent)
Record appends one audit event. Recording failures are swallowed: auditing must never fail the surrounding sync operation.
func (*Recorder) ResolveQueued ¶
ResolveQueued removes a flushed queued item.
func (*Recorder) SetLastFetch ¶
SetLastFetch records a successful fetch timestamp for a repo.