Documentation
¶
Overview ¶
Package calseed is the CALENDARS/ store-seed Materializer: it reconciles CALENDARS/<username>/<calendar>.jsonl packs (chassis/storeseed) into the calendar store (chassis/calendar) the `calendar` personality serves.
A pack OWNS one calendar of one account (managed scope). It is NDJSON:
{"calendar":{"display_name":"…","description":"…","color":"#rrggbb","timezone":"Europe/Paris","policy":{…}}}
{"name":"welcome.ics","uid":"…","event":{"summary":"…","start":"2026-09-04T18:00:00","tzid":"Europe/Paris","duration":"PT1H"}}
{"name":"notice.ics","ical":"BEGIN:VCALENDAR\r\n…"}
The optional `calendar` line (at most one, anywhere) sets the calendar's display fields; every other line is one object — `event{}` (the chassis renders it; `uid` defaults to <name>.<local>@<domain>) or `ical` text. Reconcile ensures the calendar, puts every object (unchanged content is a no-op, changed content gets a higher SEQUENCE), and deletes every live object in the calendar whose UID the pack no longer lists.
The ACCOUNT must already exist — only an op mints a password — and belong to the tenant; otherwise the pack is an error (logged, activation unaffected, retried next apply). A calendar this materializer CREATES gets a policy that denies client `put`/`delete` unless the header says otherwise: a client edit in a pack-owned calendar would be undone by the next apply — the KV managed-scope hazard in calendar clothing. Keep runtime-written calendars (OnePony's `schedule`) out of packs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Materializer ¶
type Materializer struct {
// contains filtered or unexported fields
}
Materializer reconciles CALENDARS/ packs into a *calendar.Store.
func New ¶
func New(store *chcal.Store, shared bool) *Materializer
New builds the calendar Materializer. shared declares whether the store backend is fleet-shared (postgres) — reconciled once on the origin — or per-node (sqlite). The wiring layer (server.go) knows the backend.
func (*Materializer) Kind ¶
func (m *Materializer) Kind() string
func (*Materializer) Reconcile ¶
func (m *Materializer) Reconcile(ctx context.Context, scope storeseed.Scope, packs []storeseed.RawPack) error
Reconcile makes each pack's calendar match the pack. Errors are aggregated per pack so one bad pack does not skip the rest.
func (*Materializer) Shared ¶
func (m *Materializer) Shared() bool