type
BoundTypedCollection
Typed collection methods for strict writes, incomplete working drafts, publication, reads, and deletion.
Properties
| Property | Type | Description |
|---|---|---|
Create(ctx, input, options) | (Document, | Create from the strict Create model; draft-enabled resources default to draft unless options.Draft explicitly requests publication. |
CreateDraft(ctx, input, options) | (Document, | Create an incomplete working draft from the generated Draft model; forces draft intent. |
Import(ctx, input, options) | (Document, | Import a typed document while preserving migration metadata. |
Find(ctx, id, options) | (Document, | Read one locale with optional population, projection and exact actor identity. |
List(ctx, options) | (TypedPage[Document], | List and JSON-decode a typed page into generated models. |
Update(ctx, id, input, options) | (Document, | 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, | Stage incomplete working values from the generated Draft model without changing the live snapshot. |
DiscardDraft(ctx, id, options) | (Document, | Reset pending working values to the live snapshot, subject to expected revision and update access. |
Publish(ctx, id, options) | (Document, | Validate the complete working document, including a draft's pending changes, and promote it to the live snapshot. |
PublishChanges(ctx, id, input, options) | (Document, | Apply a strict partial update from the Update model and publish the result in one operation. |
Unpublish(ctx, id, options) | (Document, | Remove the live snapshot while retaining working content as draft. |
Delete(ctx, id, options) | (Document, | 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
}Methods
BoundTypedCollection.Create()Public method BoundTypedCollection.Create from github.com/riducms/ridu/core.
BoundTypedCollection.CreateDraft()Save an incomplete new document using its generated draft input model.
BoundTypedCollection.Delete()Public method BoundTypedCollection.Delete from github.com/riducms/ridu/core.
BoundTypedCollection.DiscardDraft()DiscardDraft resets pending working values to the published document.
BoundTypedCollection.Find()Read one locale through the operation engine with optional population and projection.
BoundTypedCollection.Import()Public method BoundTypedCollection.Import from github.com/riducms/ridu/core.
BoundTypedCollection.List()Public method BoundTypedCollection.List from github.com/riducms/ridu/core.
BoundTypedCollection.Publish()Publish publishes the document's saved working content, including a draft's pending changes.
BoundTypedCollection.PublishChanges()PublishChanges applies input and publishes the result in one operation. A published document in a versioned collection changes this way; Update refuses it with publish_required.
BoundTypedCollection.SaveDraft()Stage incomplete edits without replacing a document's published snapshot.
BoundTypedCollection.Unpublish()Unpublish removes the published document and keeps its working content.
BoundTypedCollection.Update()Public method BoundTypedCollection.Update from github.com/riducms/ridu/core.