type

LocalAPI

type LocalAPI struct { engine *operationengine.Engine }

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

Source core/local.go:15

CreateLocalAPI.Create
Create and validate a document.
DuplicateLocalAPI.Duplicate
Copy an authorized source and apply overrides.
FindLocalAPI.Find
Read one authorized document.
ListLocalAPI.List
List documents with filters, sorting, and population.
UpdateLocalAPI.Update
Update a document through the operation engine.
DeleteLocalAPI.Delete
Trash or delete an authorized document.
RestoreDeletedLocalAPI.RestoreDeleted
Move an authorized trashed document back into ordinary reads.
PublishLocalAPI.Publish
Publish a versioned document.
UnpublishLocalAPI.Unpublish
Return a versioned document to draft.
VersionsLocalAPI.Versions
Read authorized retained revisions.
RestoreLocalAPI.Restore
Restore a retained revision as the current published document.
Globalmethod
Read a global document.
UpdateGlobalmethod
Update a global document.

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().

Example

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

Methods