type
Store
type Store struct {
pool *pgxpool.Pool
uploadLockPool *pgxpool.Pool
uploadLockWait time.Duration
}A PostgreSQL implementation of Ridu’s document, snapshot, auth, preference, task, job, lock, upload-reference, and migration store contracts.
Source adapters/postgres/postgres.go:30
Implemented capabilities
store.Storedocument transactions- Begins atomic read-write operation transactions.
store.SnapshotStorestable snapshots- Begins stable read snapshots for upload reconciliation and other cross-page scans.
store.HealthStoreconnectivity- Checks PostgreSQL connectivity through Ping.
store.ReadinessStoreruntime readiness- Checks connectivity, the completed ledger head manifest, and incomplete phased work.
store.MigrationReadinessStoreexact executable history- Checks the complete ordered ledger against the fingerprint embedded in the release binary.
store.PreferenceStorepreferences- Persists per-user admin and application settings.
store.DocumentLockStoredocument locks- Acquires, renews, takes over, and releases authoring leases.
store.AuthStoreauthentication- Persists password state, sessions, tokens, API keys, and auth rate limits.
store.AuthMaintenanceStoreauth maintenance- Prunes expired sessions and API keys in bounded batches.
store.AuthUnlockStoreaccount unlocks- Clears authorized persisted account lockout state.
store.TaskStoredurable tasks- Enqueues, leases, completes, retries, cancels, inspects, and prunes durable work.
store.UploadObjectLockerupload coordination- Serializes upload object creation, adoption, and destructive deletion across processes.
Use the application and Local API for content operations. These capability interfaces are primarily useful to framework/runtime integrations. Transactions returned by Begin implement store.Transaction, AuthTransaction, AuthBootstrapTransaction, AuthUnlockTransaction, VersionTransaction, UploadReferenceTransaction, and transaction-level UploadObjectLocker.
Methods
Store.Close()Close both the document pool and dedicated upload-lock pool.
Store.Ping()Check database connectivity.
Store.Ready()Prove connectivity and completed migration state for the running manifest.
Store.ReadyWithMigrationHistory()Prove ordinary readiness and exact agreement with executable migration history.
Store.Begin()Begin a read-write document transaction.
Store.BeginSnapshot()Begin a stable read snapshot.
Store.Plan()Inspect the live database and plan only a safe development synchronization.
Store.ApplyPlan()Apply a non-destructive development plan in one transaction.
Store.ApplyArtifacts()Validate all immutable history, take an advisory lock, and apply each pending artifact.
Store.ApplyArtifactsWithOptions()Apply artifacts with explicit maintenance, timeout, and stop-boundary controls.
Store.ArtifactStatus()Report applied/pending artifacts and durable phased progress.
Store.ArtifactPlan()Return immutable execution topology and checkpoints without applying work.
Store.AcquireDocumentLock()Public method Store.AcquireDocumentLock from github.com/riducms/ridu/adapters/postgres.
Store.AllowAuthAttempt()Public method Store.AllowAuthAttempt from github.com/riducms/ridu/adapters/postgres.
Store.CancelTask()Public method Store.CancelTask from github.com/riducms/ridu/adapters/postgres.
Store.ChangePasswordHash()Public method Store.ChangePasswordHash from github.com/riducms/ridu/adapters/postgres.
Store.ClaimTasks()Public method Store.ClaimTasks from github.com/riducms/ridu/adapters/postgres.
Store.CompleteTask()Public method Store.CompleteTask from github.com/riducms/ridu/adapters/postgres.
Store.CreateAPIKey()Public method Store.CreateAPIKey from github.com/riducms/ridu/adapters/postgres.
Store.CreateAuthToken()Public method Store.CreateAuthToken from github.com/riducms/ridu/adapters/postgres.
Store.CreateSession()Public method Store.CreateSession from github.com/riducms/ridu/adapters/postgres.
Store.DeleteAPIKey()Public method Store.DeleteAPIKey from github.com/riducms/ridu/adapters/postgres.
Store.DeletePreference()Public method Store.DeletePreference from github.com/riducms/ridu/adapters/postgres.
Store.DeletePreferences()Public method Store.DeletePreferences from github.com/riducms/ridu/adapters/postgres.
Store.DeleteSession()Public method Store.DeleteSession from github.com/riducms/ridu/adapters/postgres.
Store.DeleteUserSession()Public method Store.DeleteUserSession from github.com/riducms/ridu/adapters/postgres.
Store.DeleteUserSessions()Public method Store.DeleteUserSessions from github.com/riducms/ridu/adapters/postgres.
Store.DismissTaskForTarget()Public method Store.DismissTaskForTarget from github.com/riducms/ridu/adapters/postgres.
Store.EnqueueTask()Public method Store.EnqueueTask from github.com/riducms/ridu/adapters/postgres.
Store.FailTask()Public method Store.FailTask from github.com/riducms/ridu/adapters/postgres.
Store.FindAPIKey()Public method Store.FindAPIKey from github.com/riducms/ridu/adapters/postgres.
Store.FindAuthCredential()Public method Store.FindAuthCredential from github.com/riducms/ridu/adapters/postgres.
Store.FindDocumentLock()Public method Store.FindDocumentLock from github.com/riducms/ridu/adapters/postgres.
Store.FindSession()Public method Store.FindSession from github.com/riducms/ridu/adapters/postgres.
Store.FindTask()Public method Store.FindTask from github.com/riducms/ridu/adapters/postgres.
Store.ForceUnlock()Public method Store.ForceUnlock from github.com/riducms/ridu/adapters/postgres.
Store.GetPreference()Public method Store.GetPreference from github.com/riducms/ridu/adapters/postgres.
Store.HeartbeatTask()Public method Store.HeartbeatTask from github.com/riducms/ridu/adapters/postgres.
Store.ListAPIKeys()Public method Store.ListAPIKeys from github.com/riducms/ridu/adapters/postgres.
Store.ListSessions()Public method Store.ListSessions from github.com/riducms/ridu/adapters/postgres.
Store.ListTasks()Public method Store.ListTasks from github.com/riducms/ridu/adapters/postgres.
Store.LockUploadObjects()LockUploadObjects uses session advisory locks so object-store deletion and migration-owned adoption of an existing key cannot pass each other between database transactions or application processes.
Store.PruneExpiredAuth()PruneExpiredAuth removes one bounded batch from each expiring durable credential family. The candidate ordering matches the lifecycle indexes; row locks let every process run the same maintenance cycle without duplicate work or an application-wide coordinator.
Store.PruneTasks()Public method Store.PruneTasks from github.com/riducms/ridu/adapters/postgres.
Store.RecordFailedLogin()Public method Store.RecordFailedLogin from github.com/riducms/ridu/adapters/postgres.
Store.ReleaseDocumentLock()Public method Store.ReleaseDocumentLock from github.com/riducms/ridu/adapters/postgres.
Store.ReleaseTask()Public method Store.ReleaseTask from github.com/riducms/ridu/adapters/postgres.
Store.ResetLoginAttempts()Public method Store.ResetLoginAttempts from github.com/riducms/ridu/adapters/postgres.
Store.ResetPasswordWithToken()Public method Store.ResetPasswordWithToken from github.com/riducms/ridu/adapters/postgres.
Store.RotateSession()Public method Store.RotateSession from github.com/riducms/ridu/adapters/postgres.
Store.SetPasswordHash()Public method Store.SetPasswordHash from github.com/riducms/ridu/adapters/postgres.
Store.SetPreference()Public method Store.SetPreference from github.com/riducms/ridu/adapters/postgres.
Store.TouchAPIKey()Public method Store.TouchAPIKey from github.com/riducms/ridu/adapters/postgres.
Store.UpgradePasswordHash()Public method Store.UpgradePasswordHash from github.com/riducms/ridu/adapters/postgres.
Store.VerifyEmailWithToken()Public method Store.VerifyEmailWithToken from github.com/riducms/ridu/adapters/postgres.