Versions in this module Expand all Collapse all v0 v0.1.0 Sep 14, 2026 Changes in this version + const ContentExportFormatVersion + const OpArchive + const OpContentReset + const OpDelete + const OpPublish + const OpSaveDraft + const OpUnarchive + const OpUnpublish + const StateArchived + const StateChanged + const StateDraft + const StatePublished + var ErrConflict = errors.New("content item write conflict") + var ErrNotFound = errors.New("content item not found") + func OptionalInt(v int) *int + type ArchivedContentItem struct + ArchivedAt time.Time + Fields ContentFields + ID string + Key string + OwnerRef *OwnerRef + Type ContentType + UpdatedAt time.Time + type ArchivedSnapshot struct + CreatedAt time.Time + Items []ArchivedContentItem + Revision int64 + type ArchivedSnapshotInput struct + Types []ContentType + type ContentChange struct + Op string + OwnerRef *OwnerRef + Type ContentType + type ContentExport struct + Checksum string + CreatedAt time.Time + FormatVersion int + ItemCount int + Items []*ContentItem + type ContentFields map[string]LocalizedFieldValues + type ContentItem struct + ArchivedAt *time.Time + CreatedAt time.Time + Draft *ContentSnapshot + ID string + Key string + OwnerRef *OwnerRef + Published *ContentSnapshot + Type ContentType + UpdatedAt time.Time + func (i *ContentItem) State() string + type ContentItemMatch struct + ID string + Key string + type ContentSnapshot struct + CreatedAt time.Time + Fields ContentFields + Revision int64 + SchemaHash string + SchemaVersion string + UpdatedAt time.Time + type ContentStore interface + Archive func(ctx context.Context, match ContentItemMatch) (*ContentItem, error) + Delete func(ctx context.Context, match ContentItemMatch) (bool, error) + ExportContent func(ctx context.Context) (*ContentExport, error) + GetArchivedSnapshot func(ctx context.Context, input ArchivedSnapshotInput) (*ArchivedSnapshot, error) + GetItem func(ctx context.Context, match ContentItemMatch) (*ContentItem, error) + GetSchemas func(ctx context.Context) (*SchemasResult, error) + GetSnapshot func(ctx context.Context, view SnapshotView, input SnapshotInput) (*Snapshot, error) + Publish func(ctx context.Context, match ContentItemMatch) (*ContentItem, error) + ReplaceContent func(ctx context.Context, export ContentExport) (*ReplaceContentResult, error) + SaveDraft func(ctx context.Context, input SaveDraftInput) (*ContentItem, error) + SetFieldValue func(ctx context.Context, input SetFieldValueInput) (*ContentItem, error) + Unarchive func(ctx context.Context, match ContentItemMatch) (*ContentItem, error) + Unpublish func(ctx context.Context, match ContentItemMatch) (*ContentItem, error) + type ContentType string + type ContentTypeSchema struct + Fields []FieldDefinition + Hash string + SuppressChangeEvents bool + Type ContentType + Version string + func NewSchema(t ContentType, version string, fields []FieldDefinition) ContentTypeSchema + type DeploymentRole string + const DeploymentRoleCanonical + const DeploymentRoleSandbox + func ParseDeploymentRole(value string) (DeploymentRole, error) + type Deps struct + Locales LocaleConfig + NewID func() string + Notify Notifier + Role DeploymentRole + Schemas *Registry + Store Store + type Engine struct + func New(d Deps) *Engine + func (e *Engine) Archive(ctx context.Context, match ContentItemMatch) (*ContentItem, error) + func (e *Engine) Delete(ctx context.Context, match ContentItemMatch) (bool, error) + func (e *Engine) ExportContent(ctx context.Context) (*ContentExport, error) + func (e *Engine) GetArchivedSnapshot(ctx context.Context, input ArchivedSnapshotInput) (*ArchivedSnapshot, error) + func (e *Engine) GetItem(ctx context.Context, match ContentItemMatch) (*ContentItem, error) + func (e *Engine) GetSchemas(_ context.Context) (*SchemasResult, error) + func (e *Engine) GetSnapshot(ctx context.Context, view SnapshotView, input SnapshotInput) (*Snapshot, error) + func (e *Engine) Publish(ctx context.Context, match ContentItemMatch) (*ContentItem, error) + func (e *Engine) ReplaceContent(ctx context.Context, export ContentExport) (*ReplaceContentResult, error) + func (e *Engine) SaveDraft(ctx context.Context, input SaveDraftInput) (*ContentItem, error) + func (e *Engine) SetFieldValue(ctx context.Context, input SetFieldValueInput) (*ContentItem, error) + func (e *Engine) Unarchive(ctx context.Context, match ContentItemMatch) (*ContentItem, error) + func (e *Engine) Unpublish(ctx context.Context, match ContentItemMatch) (*ContentItem, error) + type Error struct + Err error + Kind Kind + Msg string + func (e *Error) Error() string + func (e *Error) Unwrap() error + type FieldDefinition struct + ContentHint string + Description string + EditingFormat FieldEditingFormat + FormatHint string + ID FieldID + Label string + Localized bool + ReadOnly bool + Required bool + SuggestedMaxLength *int + SuggestedMinLength *int + Type FieldType + type FieldEditingFormat string + const FieldEditingFormatContentfulRichText + const FieldEditingFormatMarkdown + const FieldEditingFormatPlainText + type FieldID string + type FieldType string + const FieldTypeInteger + const FieldTypeJSON + const FieldTypeRichText + const FieldTypeSymbol + const FieldTypeText + type FieldUpdate struct + FieldID string + Locale string + Match ContentItemMatch + NewID string + Now time.Time + OwnerRef *OwnerRef + SchemaHash string + SchemaVersion string + Type ContentType + Value FieldValue + type FieldValue = any + type Kind int + const KindBadRequest + const KindConflict + const KindForbidden + const KindInternal + const KindNotAcceptable + const KindNotFound + type LocaleConfig struct + Default string + Supported []string + type LocalizedFieldValues map[string]FieldValue + type Notifier func(ContentChange) + type OwnerRef struct + ID string + Source string + Type string + type Persistor struct + func NewMongoStore(ctx context.Context, mongoURL string) (*Persistor, error) + func (p *Persistor) Close() error + func (p *Persistor) Delete(ctx context.Context, id string) error + func (p *Persistor) ExportAll(ctx context.Context) ([]*ContentItem, error) + func (p *Persistor) FindAll(ctx context.Context, types []ContentType, ownerRef *OwnerRef) ([]*ContentItem, error) + func (p *Persistor) FindArchived(ctx context.Context, types []ContentType) ([]*ContentItem, error) + func (p *Persistor) FindPublished(ctx context.Context, types []ContentType, ownerRef *OwnerRef) ([]*ContentItem, error) + func (p *Persistor) GetByID(ctx context.Context, id string) (*ContentItem, error) + func (p *Persistor) GetByKey(ctx context.Context, key string) (*ContentItem, error) + func (p *Persistor) ReplaceAll(ctx context.Context, items []*ContentItem) error + func (p *Persistor) SetField(ctx context.Context, in FieldUpdate) (*ContentItem, error) + func (p *Persistor) Upsert(ctx context.Context, item *ContentItem, expectedDraftRevision *int64) error + type Registry struct + func NewRegistry() *Registry + func (r *Registry) Register(s ContentTypeSchema) + type ReplaceContentResult struct + Checksum string + ItemCount int + type SaveDraftInput struct + ExpectedRevision *int64 + Fields ContentFields + Match ContentItemMatch + OwnerRef *OwnerRef + Type ContentType + type SchemasResult struct + Schemas []ContentTypeSchema + type SetFieldValueInput struct + FieldID string + Locale string + Match ContentItemMatch + OwnerRef *OwnerRef + Type ContentType + Value FieldValue + type Snapshot struct + CreatedAt time.Time + Items []SnapshotItem + Revision int64 + type SnapshotInput struct + OwnerRef *OwnerRef + Types []ContentType + type SnapshotItem struct + Fields ContentFields + ID string + Key string + OwnerRef *OwnerRef + State string + Type ContentType + UpdatedAt time.Time + type SnapshotView string + const SnapshotViewPreview + const SnapshotViewPublished + func (v SnapshotView) Valid() bool + type Store interface + Delete func(ctx context.Context, id string) error + ExportAll func(ctx context.Context) ([]*ContentItem, error) + FindAll func(ctx context.Context, types []ContentType, ownerRef *OwnerRef) ([]*ContentItem, error) + FindArchived func(ctx context.Context, types []ContentType) ([]*ContentItem, error) + FindPublished func(ctx context.Context, types []ContentType, ownerRef *OwnerRef) ([]*ContentItem, error) + GetByID func(ctx context.Context, id string) (*ContentItem, error) + GetByKey func(ctx context.Context, key string) (*ContentItem, error) + ReplaceAll func(ctx context.Context, items []*ContentItem) error + SetField func(ctx context.Context, in FieldUpdate) (*ContentItem, error) + Upsert func(ctx context.Context, item *ContentItem, expectedDraftRevision *int64) error