Versions in this module Expand all Collapse all v0 v0.1.9 Oct 10, 2026 v0.1.8 Oct 9, 2026 Changes in this version + var ErrBatchInvalid = errors.New("page batch invalid") + var ErrHistoryQuery = errors.New("invalid page history query") + var ErrHistoryUnavailable = errors.New("page history unavailable; no write committed") + var ErrVersionConflict = errors.New("page changed; reload before saving or deleting") + func ChangedPageStates(before, after []PageState) ([]PageState, []PageState) + func CheckPageBatch(state PageSet, batch PageBatch, allowRestore bool) error + func WithPageWriteActor(ctx context.Context, actor string) context.Context type MemoryPageStore + func (s *MemoryPageStore) ApplyPageBatch(ctx context.Context, tenantID int64, batch PageBatch) (PageBatchReceipt, error) + func (s *MemoryPageStore) ReadPageHistory(_ context.Context, tenantID int64, q PageHistoryQuery) (PageHistory, error) + func (s *MemoryPageStore) ReadPageState(_ context.Context, tenantID int64) (PageSet, error) + func (s *MemoryPageStore) RollbackPageBatch(ctx context.Context, tenantID int64, receipt PageBatchReceipt) (PageBatchReceipt, error) + type PageBaseline struct + Digest string + ID int64 + Version int + func Baseline(states []PageState) []PageBaseline + type PageBatch struct + Baseline []PageBaseline + BaselineRevision int64 + Mutations []PageMutation + TargetScope string + func BatchFor(state PageSet, mutations []PageMutation) PageBatch + func RollbackBatch(r PageBatchReceipt) (PageBatch, error) + type PageBatchReceipt struct + After []PageState + AfterRevision int64 + Before []PageState + BeforeRevision int64 + Digest string + Mapping map[string]int64 + TargetScope string + func (r *PageBatchReceipt) Seal() + type PageBatchStore interface + ApplyPageBatch func(context.Context, int64, PageBatch) (PageBatchReceipt, error) + ReadPageState func(context.Context, int64) (PageSet, error) + RollbackPageBatch func(context.Context, int64, PageBatchReceipt) (PageBatchReceipt, error) + type PageContent struct + BodyBlocks json.RawMessage + BodyHTML string + Path string + PublishAt *time.Time + Status PageStatus + Subsite string + TemplateID string + Title string + UnpublishAt *time.Time + func ContentOf(p *Page) PageContent + func (c PageContent) Digest() string + func (c PageContent) Page(tenantID, id int64, version int) *Page + func (c PageContent) Validate() error + type PageHistory struct + CurrentRevision int64 + Entries []PageHistoryEntry + HasMore bool + HistoryStartRevision int64 + NextRevision int64 + Scope string + type PageHistoryEntry struct + Actor string + After []PageState + Before []PageState + CommittedAt time.Time + Digest string + Operation string + Revision int64 + Scope string + func NewPageHistoryEntry(ctx context.Context, scope string, revision int64, operation string, ...) PageHistoryEntry + func (e PageHistoryEntry) ContentDigest() string + type PageHistoryQuery struct + AfterRevision int64 + Limit int + func (q PageHistoryQuery) Validate() error + type PageHistoryStore interface + ReadPageHistory func(context.Context, int64, PageHistoryQuery) (PageHistory, error) + type PageMutation struct + Content *PageContent + ExpectedVersion int + Key string + Kind string + TargetID int64 + type PageSet struct + Pages []PageState + Revision int64 + Scope string + type PageState struct + Content PageContent + ID int64 + Version int + func States(pages []*Page) []PageState v0.1.7 Oct 9, 2026 v0.1.6 Oct 9, 2026 v0.1.5 Jun 20, 2026 v0.1.4 Jun 20, 2026 v0.1.3 Jun 20, 2026 v0.1.2 Jun 19, 2026 Changes in this version type Page + PublishAt *time.Time + TemplateID string + UnpublishAt *time.Time type PageStatus + const StatusArchived + const StatusScheduled v0.1.1 May 26, 2026 v0.1.0 May 25, 2026 Changes in this version + var ErrDomainNotFound = errors.New("store: domain not found") + var ErrDomainTaken = errors.New("store: domain host taken") + var ErrNotFound = errors.New("page not found") + var ErrPathConflict = errors.New("page path conflict") + var ErrTenantNotFound = errors.New("store: tenant not found") + var ErrTenantSlugTaken = errors.New("store: tenant slug taken") + type Domain struct + Host string + ID int64 + Kind string + SubsiteLabel string + TenantID int64 + type MemoryPageStore struct + func NewMemoryPageStore() *MemoryPageStore + func (s *MemoryPageStore) Create(_ context.Context, tenantID int64, p *Page) error + func (s *MemoryPageStore) Delete(_ context.Context, tenantID, id int64) error + func (s *MemoryPageStore) Get(_ context.Context, tenantID, id int64) (*Page, error) + func (s *MemoryPageStore) GetByPath(_ context.Context, tenantID int64, subsite, path string) (*Page, error) + func (s *MemoryPageStore) List(_ context.Context, tenantID int64, subsite string) ([]*Page, error) + func (s *MemoryPageStore) Update(_ context.Context, tenantID int64, p *Page) error + type MemoryTenantAdminStore struct + func NewMemoryTenantAdminStore() *MemoryTenantAdminStore + func (s *MemoryTenantAdminStore) CreateDomain(_ context.Context, d *Domain) error + func (s *MemoryTenantAdminStore) CreateTenant(_ context.Context, t *Tenant) error + func (s *MemoryTenantAdminStore) DeleteDomain(_ context.Context, tenantID, id int64) error + func (s *MemoryTenantAdminStore) DeleteTenant(_ context.Context, id int64) error + func (s *MemoryTenantAdminStore) GetTenant(_ context.Context, id int64) (*Tenant, error) + func (s *MemoryTenantAdminStore) ListDomains(_ context.Context, tenantID int64) ([]*Domain, error) + func (s *MemoryTenantAdminStore) ListTenants(_ context.Context) ([]*Tenant, error) + func (s *MemoryTenantAdminStore) UpdateTenant(_ context.Context, t *Tenant) error + type Page struct + BodyBlocks json.RawMessage + BodyHTML string + CreatedAt time.Time + ID int64 + Path string + Status PageStatus + Subsite string + TenantID int64 + Title string + UpdatedAt time.Time + Version int + func (p *Page) Validate() error + type PageStatus string + const StatusDraft + const StatusPublished + type PageStore interface + Create func(ctx context.Context, tenantID int64, p *Page) error + Delete func(ctx context.Context, tenantID int64, id int64) error + Get func(ctx context.Context, tenantID int64, id int64) (*Page, error) + GetByPath func(ctx context.Context, tenantID int64, subsite, path string) (*Page, error) + List func(ctx context.Context, tenantID int64, subsite string) ([]*Page, error) + Update func(ctx context.Context, tenantID int64, p *Page) error + type Tenant struct + CreatedAt time.Time + ID int64 + Label string + Slug string + ThemeID string + UpdatedAt time.Time + type TenantAdminStore interface + CreateDomain func(ctx context.Context, d *Domain) error + CreateTenant func(ctx context.Context, t *Tenant) error + DeleteDomain func(ctx context.Context, tenantID, id int64) error + DeleteTenant func(ctx context.Context, id int64) error + GetTenant func(ctx context.Context, id int64) (*Tenant, error) + ListDomains func(ctx context.Context, tenantID int64) ([]*Domain, error) + ListTenants func(ctx context.Context) ([]*Tenant, error) + UpdateTenant func(ctx context.Context, t *Tenant) error