type

LocalAPI

In-process content operations that share the REST authorization and lifecycle pipeline.

Example

go
post, err := app.Local().Create(ctx, "posts", store.Values{
  "title": store.String("Hello, Ridu"),
}, ridu.MutationOptions{Actor: actor})
if err != nil {
  return err
}

Properties

PropertyTypeDescription
CreateLocalAPI.CreateCreate and validate a document.
DuplicateLocalAPI.DuplicateCopy an authorized source and apply overrides.
FindLocalAPI.FindRead one authorized document.
ListLocalAPI.ListList documents with filters, sorting, and population.
UpdateLocalAPI.UpdateUpdate a document through the operation engine.
DeleteLocalAPI.DeleteTrash or delete an authorized document.
RestoreDeletedLocalAPI.RestoreDeletedMove an authorized trashed document back into ordinary reads.
PublishLocalAPI.PublishPublish a versioned document.
UnpublishLocalAPI.UnpublishReturn a versioned document to draft.
VersionsLocalAPI.VersionsRead authorized retained revisions.
RestoreLocalAPI.RestoreRestore a retained revision as the current published document.
GlobalmethodRead a global document.
UpdateGlobalmethodUpdate 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

type LocalAPI struct { // contains filtered or unexported fields }

Source core/local.go:16

Methods