Module
store
github.com/riducms/ridu/store — Build and read document values for the local API and hooks. This package also defines the interfaces database adapters implement.
Interfaces 3
interface store.StoreStarts atomic transactions for operations.
interface store.TransactionAtomic document reads and mutations.
interface store.CascadeTransactionCascadeTransaction lists the documents a hard delete must also delete. Stores that support cascade delete policies implement it.
Types 19
type store.RequestCollection schema, predicates, pagination, locale, projection, and lock controls.
type store.CreateRequestValidated values and metadata for one document insertion.
type store.UpdateRequestAn authorized update with values and one explicit publication-head intent.
type store.DocumentA stored document with status and version metadata.
type store.DocumentReferenceCollection and document identity for framework-owned cleanup.
type store.ValuesA map of field names to typed values.
type store.ValueAn immutable scalar, object, list, or populated document value.
type store.StatusDraft or published document state.
type store.DeletionModeChoose active, trashed, or all documents in a store request.
type store.LockModeRow-lock strength required by a semantic read.
type store.VersionOne retained version snapshot for a document.
type store.PageA paginated result and total count.
type store.DistinctRequestOne access-filtered unique-value query over a direct field.
type store.DistinctPageAscending unique values with ordinary page metadata.
type store.IndexWindowOne half-open range over a direct unique index.
type store.WindowA count-free bounded range result.
type store.PublicationActionPublicationAction is the status transition performed by a scheduled task.
type store.SchemaRecoveryErrorSchemaRecoveryError reports stored content that cannot be interpreted safely under the active schema. Adapters must preserve the stored content and supply only schema paths and actionable diagnostics, never the unknown payload.
type store.WriteIntentWriteIntent selects the atomic relationship between a versioned document's mutable working content and its at-most-one published head.
Values 9
type store.ValueKindWhat a Value holds: null, string, number, boolean, object, list, or a populated document.
store.CloneValues()Deep-copy a field value map.
store.CloneDocument()Deep-copy document values and localization metadata.
store.Number()Construct a typed number field value.
store.Boolean()Construct a typed boolean field value.
store.Null()Construct an explicit null field value.
store.Object()Construct a defensively copied nested object value.
store.List()Construct a defensively copied list value.
store.Populated()Wrap a populated relationship document.
Functions 9
store.String()Construct a typed string field value.
store.CanonicalAuthIdentity()Normalize an authentication identity to its adapter-neutral storage and lookup key.
store.ValidateDistinctRequest()Validate the bounded direct-field distinct contract.
store.ListPageBounds()Normalize list paging and calculate safe half-open result bounds.
store.ValidateDocumentID()Validate one canonical adapter-neutral document ID.
store.CountedPage()CountedPage returns the normalized page for documents read at the bounds ListPageBounds computes for the requested page, limit and exact total.
store.HasLiveHead()HasLiveHead reports whether a working document read for an update has a live head. Authoring reads of draft-enabled collections carry the live revision. Without drafts, every write publishes or removes the live head together with the working status, so the document is published exactly when its live head exists.
store.TrimUncountedPage()TrimUncountedPage removes the overflow row from a SkipTotal read of at most limit+1 documents and reports whether it existed. Adapters trim before population so the overflow row is never materialized further.
store.UncountedPageBounds()UncountedPageBounds normalizes a SkipTotal list read without a total. The adapter reads at most limit+1 rows starting at offset; an offset of math.MaxInt cannot hold a document.
Methods 30
Value.StringValue()AuthPruneResult.Total()DeleteRestrictedError.Error()DeleteRestrictedError.Is()PopulationBudget.ConsumeDocument()Value.BooleanValue()Value.CopyDocument()Value.Kind()Value.MarshalJSON()Value.NumberValue()Value.CopyObject()Value.UnmarshalJSON()Value.CopyList()Request.CurrentRequest()SchemaRecoveryError.Error()UpdateRequest.LockedCurrent()Value.AppendJSON()Value.Elements()Value.Entries()Value.Get()Value.IsZero()Value.Len()Value.ListItem()Value.Lookup()Value.SameBacking()Value.WithListItem()Value.WithMembers()ValueKind.String()Values.MarshalJSON()Values.UnmarshalJSON()
Optional store capabilities 15
interface store.SnapshotStoreBegin reads against one stable database snapshot.
interface store.WindowTransactionOptional count-free bounded unique-index range reads.
interface store.DistinctTransactionOptional access-filtered unique-value reads.
interface store.UploadReferenceTransactionFind requested upload keys referenced by current, trashed, or versioned documents.
interface store.UploadObjectLockerSerialize object-key adoption and destructive deletion across processes.
interface store.HealthStoreConnectivity health check.
interface store.ReadinessStoreVerify the database is usable by an exact manifest and internally complete migration state.
interface store.MigrationReadinessStoreVerify the complete applied migration ledger against executable history.
interface store.PreferenceStorePersist opaque per-user application/admin settings.
interface store.DocumentLockStoreAtomically acquire, refresh, take over, and release authoring locks.
type store.PreferenceOne opaque per-user setting.
type store.DocumentLockOne expiring exclusive authoring lease.
type store.FilteredSelectionRequestCaller and access filters for one bounded frozen selection.
type store.FilteredSelectionCanonical ascending IDs and explicit overflow state.
type store.UploadReferenceRequestA bounded object-key reference query across upload schemas.
Authentication adapter contracts 12
interface store.AuthStorePersistence required by auth-enabled collections.
interface store.AuthMaintenanceStoreBounded pruning of expired auth state.
type store.AuthCredentialPrivate password and lockout state associated with one user document.
type store.AuthTokenA persisted one-way digest of a single-use recovery secret.
type store.AuthSessionA persisted opaque session digest and safe metadata.
type store.AuthAPIKeyA persisted API-key digest and safe metadata.
interface store.AuthTransactionCreate private credentials in the owning document transaction.
interface store.AuthBootstrapTransactionSerialize and atomically create the first admin credential.
interface store.AuthUnlockStoreOptional authorized account-lock reset.
interface store.AuthUnlockTransactionReset account lockout in an already-authorized document transaction.
type store.AuthPruneResultExpired session and API-key counts removed by one bounded cycle.
type store.AuthTokenPurposeStable single-use authentication token purpose.
Version adapter contracts 2
type store.VersionRequestAn access-filtered version-history query.
interface store.VersionTransactionSame-transaction snapshot persistence and access-filtered history reads.
Publishing adapter contracts 1
type store.ScheduledPublicationAdapter-neutral revision-fenced future publish record.
Task adapter contracts 7
type store.TaskAdapter-neutral durable task data.
interface store.TaskStoreGeneral-purpose durable queue persistence.
type store.TaskStatePersisted task lifecycle.
type store.TaskBackoffPersisted deterministic retry schedule.
type store.TaskClaimA bounded SKIP LOCKED claim filter and lease.
type store.TaskListBounded local task inspection filter.
type store.TaskFailureOne lease-fenced attempt failure and optional retry delay.
Reference integrity 3
type store.ReferenceDeleteRequestOne permanent-delete reconciliation request.
type store.DeleteRestrictedErrorDeterministic schema constraints preventing permanent deletion.
type store.ReferenceConstraintThe schema owner and field that restrict a hard delete.
Safety bounds 28
type store.PopulationBudgetA shared recursive population materialization budget.
constant store.MaxListWindowDocumentsThe maximum documents returned by one bounded unique-index window.
constant store.MaxUploadReferenceCandidatesThe maximum object-key set accepted by one upload-reference query.
constant store.MaxPopulationMaterializedDocumentsThe default maximum number of nested documents materialized by one populated response.
constant store.MaxAuthPruneBatchThe maximum expired-session or API-key maintenance batch.
constant store.MaxTaskPayloadBytesThe maximum encoded JSON size for durable task input or output.
constant store.MaxTaskErrorBytesThe maximum persisted UTF-8 task failure message size.
constant store.MaxTaskBatchThe maximum task claim, list, prune, queue-filter, or slug-filter batch.
constant store.MaxTaskAttemptsThe maximum configured durable task attempt count.
constant store.MaxTaskConcurrencyKeyBytesThe maximum UTF-8 byte length of a durable task concurrency key.
constant store.MaxTaskReferenceIDBytesThe maximum UTF-8 byte length of each collection or document ID in a task reference.
constant store.MaxTaskRetryDelayThe maximum durable task retry delay.
constant store.MaxTaskTimeoutThe maximum configured durable task handler timeout.
constant store.MinTaskRetentionThe minimum retention period for a terminal durable task record.
constant store.MaxTaskRetentionThe maximum retention period for a terminal durable task record.
constant store.MaxTaskLeaseDurationThe maximum lease duration for one claimed durable task.
store.NewPopulationBudget()Create a concurrency-safe recursive population budget.
store.ValidateAuthPruneBatch()Validate a maintenance batch from 1 through 500.
store.ValidateListWindowRequest()Validate one bounded unique-index range request.
store.ValidateTaskAdmission()Validate a complete durable task before admission.
store.ValidateTaskPayload()Validate a bounded non-empty JSON task payload.
store.ValidateTaskClaim()Validate one worker lease request.
store.ValidateTaskList()Validate one task-list query.
store.ValidateTaskReference()Validate a lifecycle-safe document reference.
store.ValidateTaskBatch()Validate a prune or adapter batch bound.
store.ValidateTaskLeaseDuration()Validate an operationally bounded task lease.
store.ValidateTaskFailure()Validate persisted failure and retry metadata.
store.ValidateTaskRelease()Validate worker lease-release delay and failure metadata.
Errors 1
type store.Store errorsStable adapter error sentinels.
Constants 33
constant store.AuthTokenPasswordResetconstant store.AuthTokenVerifyEmailconstant store.DeletionActiveconstant store.DeletionAllconstant store.DeletionTrashconstant store.LockMutationconstant store.LockNoneconstant store.LockReferenceconstant store.MaxDocumentIDBytesconstant store.StatusDraftconstant store.StatusPublishedconstant store.TaskBackoffExponentialconstant store.TaskBackoffFixedconstant store.TaskBackoffLinearconstant store.TaskStateCanceledconstant store.TaskStateFailedconstant store.TaskStateQueuedconstant store.TaskStateRunningconstant store.TaskStateSucceededconstant store.ValueBooleanconstant store.ValueDocumentconstant store.ValueListconstant store.ValueNullconstant store.ValueNumberconstant store.ValueObjectconstant store.ValueStringconstant store.PublicationActionPublishconstant store.PublicationActionUnpublishconstant store.WriteIntentDefaultconstant store.WriteIntentDiscardDraftconstant store.WriteIntentPublishconstant store.WriteIntentSaveDraftconstant store.WriteIntentUnpublish
Variables 6
variable store.ErrAuthInitializedPublic variable ErrAuthInitialized from github.com/riducms/ridu/store.
variable store.ErrConflictPublic variable ErrConflict from github.com/riducms/ridu/store.
variable store.ErrDeleteRestrictedPublic variable ErrDeleteRestricted from github.com/riducms/ridu/store.
variable store.ErrNotFoundPublic variable ErrNotFound from github.com/riducms/ridu/store.
variable store.ErrPopulationLimitPublic variable ErrPopulationLimit from github.com/riducms/ridu/store.
variable store.ErrTaskLeaseLostPublic variable ErrTaskLeaseLost from github.com/riducms/ridu/store.