type
Store
type Store struct {
client *mongo.Client
database *mongo.Database
now func() time.Time
closeMu sync.Mutex
closed bool
closeErr error
indexLifecycleMu sync.Mutex
indexesMu sync.RWMutex
verifiedIndexes map[schema.StableID]mongoVerifiedIndexPlan
verifiedVersionIndexes map[schema.StableID]bool
verifiedReferenceIndexes bool
verifiedPreferenceIndexes bool
verifiedDocumentLockIndexes bool
verifiedTaskIndexes bool
verifiedAuthIndexes bool
verifiedUploadLockIndexes bool
uploadLockRetry time.Duration
uploadLockWait time.Duration
uploadLockLifecycleMu sync.Mutex
uploadLockLifecycleCtx context.Context
uploadLockLifecycleCancel context.CancelFunc
uploadLockOperations sync.WaitGroup
}A replica-set implementation of Ridu’s document, snapshot, auth, preference, task, lock, upload, readiness, and migration contracts.
Source adapters/mongodb/mongodb.go:50
Use the application and Local API for content operations; the adapter exposes no raw BSON filter, database handle, ObjectID contract, or second Mongo-specific content API.
Transactions add auth/bootstrap/unlock, versions, distinct, windows, upload-reference lookup, and transaction-level upload locking to store.Transaction.
Production support is limited to generated starter and blank applications on Linux x86-64 with MongoDB Community 8.2.9, SCRAM-SHA-256, verified TLS, and a writable three-member replica set. Atlas, DocumentDB, Cosmos DB, standalone or sharded deployments, and other versions, topologies, and platforms are not supported.
Methods
Store.Close()Idempotently stop adapter work and release the MongoDB client within an internal bound.
Store.Ping()Check that the replica set can serve a primary read.
Store.Ready()Prove manifest-ledger and complete managed-index readiness for compatibility callers.
Store.ReadyWithMigrationHistory()Prove exact executable history, manifest, completed step state, and managed-index readiness.
Store.Begin()Begin a majority-committed snapshot-isolated write transaction.
Store.BeginSnapshot()Begin a stable snapshot in read-only adapter mode.
Store.SyncIndexes()Create only missing managed indexes for explicit development/bootstrap synchronization.
Store.VerifyIndexes()Non-mutatingly verify the complete managed index plan and authorize this Store instance.
Store.ApplyArtifacts()Validate complete immutable history, take the fenced lease, and apply pending work.
Store.ApplyArtifactsWithOptions()Apply pending physical and semantic steps with explicit maintenance and bounded coordination.
Store.ArtifactStatus()Validate immutable history and report durable artifact, phase, and step progress.
Store.ArtifactPlan()Return the same strict state with deterministic phase and step topology.
Store.AcquireDocumentLock()Public method Store.AcquireDocumentLock from github.com/riducms/ridu/adapters/mongodb.
Store.AllowAuthAttempt()Public method Store.AllowAuthAttempt from github.com/riducms/ridu/adapters/mongodb.
Store.CancelTask()Public method Store.CancelTask from github.com/riducms/ridu/adapters/mongodb.
Store.ChangePasswordHash()Public method Store.ChangePasswordHash from github.com/riducms/ridu/adapters/mongodb.
Store.ClaimTasks()Public method Store.ClaimTasks from github.com/riducms/ridu/adapters/mongodb.
Store.CompleteTask()Public method Store.CompleteTask from github.com/riducms/ridu/adapters/mongodb.
Store.CreateAPIKey()Public method Store.CreateAPIKey from github.com/riducms/ridu/adapters/mongodb.
Store.CreateAuthToken()Public method Store.CreateAuthToken from github.com/riducms/ridu/adapters/mongodb.
Store.CreateSession()Public method Store.CreateSession from github.com/riducms/ridu/adapters/mongodb.
Store.DeleteAPIKey()Public method Store.DeleteAPIKey from github.com/riducms/ridu/adapters/mongodb.
Store.DeletePreference()Public method Store.DeletePreference from github.com/riducms/ridu/adapters/mongodb.
Store.DeletePreferences()Public method Store.DeletePreferences from github.com/riducms/ridu/adapters/mongodb.
Store.DeleteSession()Public method Store.DeleteSession from github.com/riducms/ridu/adapters/mongodb.
Store.DeleteUserSession()Public method Store.DeleteUserSession from github.com/riducms/ridu/adapters/mongodb.
Store.DeleteUserSessions()Public method Store.DeleteUserSessions from github.com/riducms/ridu/adapters/mongodb.
Store.DismissTaskForTarget()Public method Store.DismissTaskForTarget from github.com/riducms/ridu/adapters/mongodb.
Store.EnqueueTask()Public method Store.EnqueueTask from github.com/riducms/ridu/adapters/mongodb.
Store.FailTask()Public method Store.FailTask from github.com/riducms/ridu/adapters/mongodb.
Store.FindAPIKey()Public method Store.FindAPIKey from github.com/riducms/ridu/adapters/mongodb.
Store.FindAuthCredential()Public method Store.FindAuthCredential from github.com/riducms/ridu/adapters/mongodb.
Store.FindDocumentLock()Public method Store.FindDocumentLock from github.com/riducms/ridu/adapters/mongodb.
Store.FindSession()Public method Store.FindSession from github.com/riducms/ridu/adapters/mongodb.
Store.FindTask()Public method Store.FindTask from github.com/riducms/ridu/adapters/mongodb.
Store.ForceUnlock()Public method Store.ForceUnlock from github.com/riducms/ridu/adapters/mongodb.
Store.GetPreference()Public method Store.GetPreference from github.com/riducms/ridu/adapters/mongodb.
Store.HeartbeatTask()Public method Store.HeartbeatTask from github.com/riducms/ridu/adapters/mongodb.
Store.ListAPIKeys()Public method Store.ListAPIKeys from github.com/riducms/ridu/adapters/mongodb.
Store.ListSessions()Public method Store.ListSessions from github.com/riducms/ridu/adapters/mongodb.
Store.ListTasks()Public method Store.ListTasks from github.com/riducms/ridu/adapters/mongodb.
Store.LockUploadObjects()LockUploadObjects acquires one separately committed exact-owner lock set. Acquisition is all-or-none, and rows remain held until release. Graceful shutdown must drain callers before Store.Close; crash-abandoned rows require explicit operator recovery.
Store.PruneExpiredAuth()Public method Store.PruneExpiredAuth from github.com/riducms/ridu/adapters/mongodb.
Store.PruneTasks()Public method Store.PruneTasks from github.com/riducms/ridu/adapters/mongodb.
Store.RecordFailedLogin()Public method Store.RecordFailedLogin from github.com/riducms/ridu/adapters/mongodb.
Store.ReleaseDocumentLock()Public method Store.ReleaseDocumentLock from github.com/riducms/ridu/adapters/mongodb.
Store.ReleaseTask()Public method Store.ReleaseTask from github.com/riducms/ridu/adapters/mongodb.
Store.ResetLoginAttempts()Public method Store.ResetLoginAttempts from github.com/riducms/ridu/adapters/mongodb.
Store.ResetPasswordWithToken()Public method Store.ResetPasswordWithToken from github.com/riducms/ridu/adapters/mongodb.
Store.RotateSession()Public method Store.RotateSession from github.com/riducms/ridu/adapters/mongodb.
Store.SetPasswordHash()Public method Store.SetPasswordHash from github.com/riducms/ridu/adapters/mongodb.
Store.SetPreference()Public method Store.SetPreference from github.com/riducms/ridu/adapters/mongodb.
Store.TouchAPIKey()Public method Store.TouchAPIKey from github.com/riducms/ridu/adapters/mongodb.
Store.UpgradePasswordHash()Public method Store.UpgradePasswordHash from github.com/riducms/ridu/adapters/mongodb.
Store.VerifyEmailWithToken()Public method Store.VerifyEmailWithToken from github.com/riducms/ridu/adapters/mongodb.
Related types
StableIDA deterministic identifier for schema evolution.