Versions in this module Expand all Collapse all v0 v0.2.2 Nov 10, 2026 v0.2.1 Nov 10, 2026 v0.2.0 Nov 8, 2026 Changes in this version + const RoleApp + const RolePolicyOwner + func ApplyRuntimeGrants(ctx context.Context, dsn string) ([]string, error) + func BootstrapRoles(ctx context.Context, dsn string) ([]string, error) + func RoleExists(ctx context.Context, dsn, role string) (bool, error) + func SetAppRolePassword(ctx context.Context, dsn, password string) error + func VerifyRuntimeIdentity(ctx context.Context, pool *pgxpool.Pool) error + type AuditReport struct + Failures []string + Notices []string + Passed bool + func RunPrivilegeAudit(ctx context.Context, dsn string) (AuditReport, error) v0.1.0 Nov 3, 2026 Changes in this version + const CodeDBMigrationDirty + const CodeDBMigrationFailed + const CodeDBMigrationLockTimeout + const CodeDBSuppressed + const CodeDBUnreachable + const CodeDBUsage + const CodeDBVersion + const DefaultPoolHealthCheck + const DefaultPoolMaxConnIdleTime + const DefaultPoolMaxConnLifetime + const DefaultPoolMaxConns + const DefaultPoolMinConns + const RetractLimit + const ServerVersionNumQuery + const StateAhead + const StateAtHead + const StateBehind + const StateDirty + const StateUninitialized + var ErrSourceNotFound = errors.New("data source not registered") + func CheckPGVersion(ctx context.Context, rawDSN string, minMajor int) (int, error) + func CheckReachable(ctx context.Context, rawDSN string) error + func ForceMigrationVersion(rawDSN string, lockTimeoutMs, version int) error + func HeadVersion() (uint, error) + func MigrationFiles() ([]string, error) + func MustRedactDSN(rawDSN string) string + func NewPool(ctx context.Context, rawDSN string) (*pgxpool.Pool, error) + func PGMajorVersion(ctx context.Context, conn *pgx.Conn) (int, error) + func PingPool(ctx context.Context, pool *pgxpool.Pool) error + func RedactDSN(rawDSN string) (string, error) + func RunMigrations(rawDSN string, lockTimeoutMs int) (applied int, head uint, err error) + type CheckOutcome string + const CheckFail + const CheckHint + const CheckPass + const CheckSkip + type CheckResult struct + Detail string + Err error + Fix string + Name string + Outcome CheckOutcome + func DoctorDBChecks(ctx context.Context, rawDSN string, minMajor int) []CheckResult + type CollectionJob struct + Error string + FinishedAt *time.Time + ID int64 + Kind string + SourceID int64 + StartedAt time.Time + Stats map[string]any + Status string + type DBError struct + Code string + Detail string + Next string + Why string + func (e *DBError) Error() string + type DataSourceRow struct + ConfigJSON []byte + Connector string + CreatedAt time.Time + Enabled bool + ID int64 + Name string + TermsRef string + type DeadLetterRecord struct + Attempts int + FirstSeen time.Time + ID int64 + LastSeen time.Time + Payload map[string]any + Reason string + SourceID int64 + type Diagnosis struct + FailedFile string + ForceHint string + InspectionSQL []string + Status *MigrationStatus + func DiagnoseMigration(ctx context.Context, rawDSN string) (*Diagnosis, error) + type Fact = storage.Fact + type FactResult = storage.FactResult + type IngestStats = storage.IngestStats + type MigrationStatus struct + Dirty bool + Head uint + Pending []string + State string + Version int64 + func GetMigrationStatus(ctx context.Context, rawDSN string) (*MigrationStatus, error) + type PurgeStats struct + Assets int64 + FixtureSourcePresent bool + Observations int64 + Services int64 + func PurgeFixtureData(ctx context.Context, pool *pgxpool.Pool) (PurgeStats, error) + type RetractStats struct + AssetsRetracted int + AuditRows int + ObservationsRemoved int + ServicesRemoved int + type Store struct + func NewStore(pool *pgxpool.Pool) *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) (rule suppress.Rule, existed bool, err 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) (sourceID int64, err 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) (id int64, inserted bool, err 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) 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) UpsertAsset(ctx context.Context, a *storage.Asset) (id int64, inserted bool, err error) + func (s *Store) UpsertService(ctx context.Context, sv *storage.Service) (id int64, inserted bool, err error) + type SuppressInput struct + CreatedBy string + ExpiresAt *time.Time + Kind suppress.Kind + Reason string + Value string