syncaudit

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 3 Imported by: 0

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

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

func New(db *store.DB) *Recorder

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) LastFetch

func (r *Recorder) LastFetch(repoKey string) (int64, bool)

LastFetch returns the last-fetch unix timestamp for a repo.

func (*Recorder) MarkQueued

func (r *Recorder) MarkQueued(id int64, status, detail string)

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

func (r *Recorder) ResolveQueued(id int64)

ResolveQueued removes a flushed queued item.

func (*Recorder) SetLastFetch

func (r *Recorder) SetLastFetch(repoKey string, seconds int64)

SetLastFetch records a successful fetch timestamp for a repo.

Jump to

Keyboard shortcuts

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