type

BoundTypedCollection

Typed collection methods for strict writes, incomplete working drafts, publication, reads, and deletion.

Properties

PropertyTypeDescription
Create(ctx, input, options)(Document, error)Create from the strict Create model; draft-enabled resources default to draft unless options.Draft explicitly requests publication.
CreateDraft(ctx, input, options)(Document, error)Create an incomplete working draft from the generated Draft model; forces draft intent.
Import(ctx, input, options)(Document, error)Import a typed document while preserving migration metadata.
Find(ctx, id, options)(Document, error)Read one locale with optional population, projection and exact actor identity.
List(ctx, options)(TypedPage[Document], error)List and JSON-decode a typed page into generated models.
Update(ctx, id, input, options)(Document, error)Apply a strict partial working update. A published versioned document fails with publish_required unless the update has draft intent; use PublishChanges to edit and publish it.
SaveDraft(ctx, id, input, options)(Document, error)Stage incomplete working values from the generated Draft model without changing the live snapshot.
DiscardDraft(ctx, id, options)(Document, error)Reset pending working values to the live snapshot, subject to expected revision and update access.
Publish(ctx, id, options)(Document, error)Validate the complete working document, including a draft's pending changes, and promote it to the live snapshot.
PublishChanges(ctx, id, input, options)(Document, error)Apply a strict partial update from the Update model and publish the result in one operation.
Unpublish(ctx, id, options)(Document, error)Remove the live snapshot while retaining working content as draft.
Delete(ctx, id, options)(Document, error)Delete through the ordinary access-controlled operation pipeline.

How it works

Inputs and outputs cross the same operation engine as untyped LocalAPI. Draft is a separate generated input model with optional editorial fields, not a relaxation of the strict Create or Update model. JSON conversion reports incompatible field types; unknown stored fields are ignored and absent model fields keep their Go zero values. The wrapper does not create a second runtime.

Full signature

type BoundTypedCollection[Document, Create, Update, Draft any] struct { // contains filtered or unexported fields }

Source core/typed_local.go:38

Methods