Versions in this module Expand all Collapse all v0 v0.2.2 Nov 10, 2026 v0.2.1 Nov 10, 2026 Changes in this version + const RetractLimit + var ErrSourceNotFound = fmt.Errorf("data source not registered") + func BuildDSN(path string) string + func ForceVersion(ctx context.Context, db *sql.DB, version int64, dirty bool) error + func FormatTS(t time.Time) string + func IsSuppressedError(err error) bool + func MigrationHead() (int, error) + func ParseTS(s string) (time.Time, error) + type DataSourceRow struct + ConfigJSON []byte + Connector string + CreatedAt time.Time + Enabled bool + ID int64 + Name string + TermsRef string + type DeadLetterRecord struct + Failure string + ID int64 + Payload []byte + Reason string + Resolved string + Status string + type Fact = storage.Fact + type FactResult = storage.FactResult + type IndexStats struct + Assets int64 + FixtureObs int64 + LastObserved *time.Time + Observations int64 + Services int64 + type IngestStats = storage.IngestStats + type MigrationState string + const StateAhead + const StateAtHead + const StateBehind + const StateDirty + const StateUninitialized + type MigrationStatus struct + Dirty bool + Head int + State MigrationState + Version int64 + func GetMigrationStatus(ctx context.Context, db *sql.DB) (MigrationStatus, error) + func Migrate(ctx context.Context, db *sql.DB) (MigrationStatus, error) + type OpenMode string + const OpenCreated + const OpenExisting + type OpenResult struct + DB *sql.DB + Mode OpenMode + Path string + PermNote string + func Open(path string) (*OpenResult, error) + type PurgeStats struct + AssetsRemoved int64 + ObservationsRemoved int64 + ServicesRemoved int64 + type Querier interface + ExecContext func(ctx context.Context, query string, args ...any) (sql.Result, error) + QueryContext func(ctx context.Context, query string, args ...any) (*sql.Rows, error) + QueryRowContext func(ctx context.Context, query string, args ...any) *sql.Row + type RetractStats struct + AssetsRetracted int + AuditRows int + ObservationsRemoved int + ServicesRemoved int + type Store struct + DB *sql.DB + func NewStore(db *sql.DB) *Store + func (s *Store) AddDeadLetter(ctx context.Context, sourceID int64, payload map[string]any, reason string) error + func (s *Store) AddSuppression(ctx context.Context, in SuppressInput) (suppress.Rule, bool, error) + func (s *Store) Close() error + func (s *Store) DeadLetterStats(ctx context.Context) (map[int64]int, error) + func (s *Store) DiscardDeadLetters(ctx context.Context, sourceID int64, limit int) (int64, error) + func (s *Store) EnsureFixtureSource(ctx context.Context) (int64, error) + func (s *Store) EnsureSource(ctx context.Context, name, connector, termsRef string, cfg map[string]any) (int64, error) + func (s *Store) FailDeadLetter(ctx context.Context, id int64, failure string) error + func (s *Store) FinishCollectionJob(ctx context.Context, jobID int64, status string, stats map[string]any, ...) error + func (s *Store) GetCheckpoint(ctx context.Context, sourceID int64, key string) (string, error) + func (s *Store) GetSource(ctx context.Context, name string) (DataSourceRow, error) + func (s *Store) IndexSeedValues(ctx context.Context, kind string, limit int) ([]string, error) + func (s *Store) IngestFact(ctx context.Context, f *Fact) (FactResult, error) + func (s *Store) IngestFacts(ctx context.Context, facts []Fact) (IngestStats, error) + func (s *Store) InsertObservation(ctx context.Context, o *storage.Observation) (int64, bool, error) + func (s *Store) ListSources(ctx context.Context) ([]DataSourceRow, error) + func (s *Store) ListSuppressions(ctx context.Context) ([]suppress.Rule, error) + func (s *Store) LoadSuppressions(ctx context.Context) ([]suppress.Rule, error) + func (s *Store) PendingDeadLetters(ctx context.Context, sourceID int64, limit int) ([]DeadLetterRecord, error) + func (s *Store) PurgeFixtures(ctx context.Context) (PurgeStats, error) + func (s *Store) RemoveSuppression(ctx context.Context, id int64) (bool, error) + func (s *Store) ResolveDeadLetter(ctx context.Context, id int64, note string) error + func (s *Store) RetractSuppressed(ctx context.Context, rule suppress.Rule) (RetractStats, error) + func (s *Store) SetCheckpoint(ctx context.Context, sourceID int64, key, cursor string) error + func (s *Store) SetFingerprintEngine(reg *fprule.Registry) + func (s *Store) SetSourceEnabled(ctx context.Context, name string, enabled bool) error + func (s *Store) StartCollectionJob(ctx context.Context, sourceID int64, kind string) (int64, error) + func (s *Store) Stats(ctx context.Context) (IndexStats, error) + func (s *Store) SuppressionApplications(ctx context.Context, limit int) ([]SuppressionApplication, error) + func (s *Store) UpsertAsset(ctx context.Context, a *storage.Asset) (int64, bool, error) + func (s *Store) UpsertService(ctx context.Context, sv *storage.Service) (int64, bool, error) + type SuppressInput struct + CreatedBy string + ExpiresAt *time.Time + Kind suppress.Kind + Reason string + Value string + type SuppressionApplication struct + Action string + AppliedAt string + AssetID int64 + Detail string + ID int64 + SuppressionID int64