type
LocalAPI
In-process content operations over the shared operation engine.
Example
post, err := app.Local().Create(ctx, "posts", store.Values{
"title": store.String("Hello, Ridu"),
}, ridu.MutationOptions{Actor: actor})
if err != nil {
return err
}Properties
| Property | Type | Description |
|---|---|---|
Create | LocalAPI.Create | Create and validate a document. |
Duplicate | LocalAPI.Duplicate | Copy an authorized source and apply overrides. |
Find | LocalAPI.Find | Read one authorized document. |
List | LocalAPI.List | List documents with filters, sorting, and population. |
Update | LocalAPI.Update | Update a document through the operation engine. |
Delete | LocalAPI.Delete | Trash or delete an authorized document. |
RestoreDeleted | LocalAPI.RestoreDeleted | Move an authorized trashed document back into ordinary reads. |
Publish | LocalAPI.Publish | Publish a versioned document. |
Unpublish | LocalAPI.Unpublish | Return a versioned document to draft. |
Versions | LocalAPI.Versions | Read authorized retained revisions. |
Restore | LocalAPI.Restore | Restore a retained revision as the current published document. |
Global | method | Read a global document. |
UpdateGlobal | method | Update a global document. |
How it works
HookContext.Local reuses the active transaction during pre-commit phases. AfterCommit and AfterError run outside it, so nested calls start a new transaction. Application services normally access this API through app.Local().
Full signature
Methods
LocalAPI.Create()Create creates a document and applies the requested bounded population plan to the response inside the write transaction.
LocalAPI.Duplicate()Duplicate duplicates a document and populates the returned copy inside the write transaction.
LocalAPI.Find()Find reads one document through the operation engine with a transport-owned projection and population plan.
LocalAPI.List()List authorized documents with filtering, pagination, projection, sorting, and population.
LocalAPI.Distinct()Return paginated unique values for one direct field after access checks.
LocalAPI.ListWindow()Read one count-free bounded unique-index range for reconciliation work.
LocalAPI.Update()Update updates a document and applies the requested bounded population plan to the response inside the write transaction.
LocalAPI.Delete()Public method LocalAPI.Delete from github.com/riducms/ridu/core.
LocalAPI.RestoreDeleted()Public method LocalAPI.RestoreDeleted from github.com/riducms/ridu/core.
LocalAPI.DeletePermanent()Public method LocalAPI.DeletePermanent from github.com/riducms/ridu/core.
LocalAPI.Publish()Public method LocalAPI.Publish from github.com/riducms/ridu/core.
LocalAPI.PublishChanges()Public method LocalAPI.PublishChanges from github.com/riducms/ridu/core.
LocalAPI.Unpublish()Public method LocalAPI.Unpublish from github.com/riducms/ridu/core.
LocalAPI.Versions()Versions preserves the exact authenticated collection identity while reading retained revisions.
LocalAPI.Version()Version preserves the exact authenticated collection identity while reading one retained revision.
LocalAPI.Restore()Public method LocalAPI.Restore from github.com/riducms/ridu/core.
LocalAPI.RestoreAsDraft()RestoreAsDraft restores a retained revision while explicitly keeping the current document unpublished.
LocalAPI.Import()Import creates a document with a migration-owned stable ID while still running ordinary access, validation, hooks, transaction, and version logic.
LocalAPI.Capabilities()Evaluate collection, document, and field access without side effects.
LocalAPI.MutateJoin()MutateJoin preserves the exact authenticated collection identity while applying inverse relationship deltas.
LocalAPI.CopyLocale()CopyLocale preserves the exact authenticated collection identity for both the source read and destination mutation lifecycle.
LocalAPI.BulkUpdate()BulkUpdate atomically applies the same partial values to every document.
LocalAPI.BulkPublish()BulkPublish atomically publishes every selected versioned document.
LocalAPI.BulkUnpublish()BulkUnpublish atomically returns every selected versioned document to draft.
LocalAPI.BulkDelete()BulkDelete atomically deletes or trashes every selected document.
LocalAPI.BulkRestoreDeleted()BulkRestoreDeleted atomically restores selected documents from trash.
LocalAPI.BulkDeletePermanent()BulkDeletePermanent atomically permanently deletes selected trashed documents.
LocalAPI.EmptyTrash()EmptyTrash permanently deletes every accessible trashed document in one bounded atomic batch.
LocalAPI.Global()Global reads a singleton with transport-owned projection and population through the ordinary operation engine.
LocalAPI.UpdateGlobal()UpdateGlobal updates a singleton and populates its response in the same write transaction.
LocalAPI.PublishGlobal()Public method LocalAPI.PublishGlobal from github.com/riducms/ridu/core.
LocalAPI.PublishGlobalChanges()Public method LocalAPI.PublishGlobalChanges from github.com/riducms/ridu/core.
LocalAPI.UnpublishGlobal()Public method LocalAPI.UnpublishGlobal from github.com/riducms/ridu/core.
LocalAPI.CopyGlobalLocale()Copy every localized singleton field from one locale to another.
LocalAPI.GlobalVersion()Public method LocalAPI.GlobalVersion from github.com/riducms/ridu/core.
LocalAPI.RestoreGlobal()RestoreGlobal restores a retained global revision.
LocalAPI.RestoreGlobalAsDraft()RestoreGlobalAsDraft restores a retained global revision without publishing it.
LocalAPI.GlobalVersions()Public method LocalAPI.GlobalVersions from github.com/riducms/ridu/core.
LocalAPI.CountGlobalVersions()CountGlobalVersions counts retained, authorized global snapshots without reading their values.
LocalAPI.CountVersions()CountVersions counts retained, authorized collection snapshots without reading their values.
LocalAPI.DiscardDraft()DiscardDraft atomically resets a pending working version to the live head. It requires Update access and an expected working revision when provided.
LocalAPI.DiscardGlobalDraft()DiscardGlobalDraft resets a singleton's pending working version to its live head.
LocalAPI.ListJoin()ListJoin reads a configured inverse join through source and target read access. Only the engine derives the membership predicate; caller Where and Sort keep ordinary List field-query restrictions even when the backing relation is private.