Help us shape the future of Go! Take the 2026 Go Developer Survey

conseed

package
v0.2.49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package conseed is the CONTACTS/ store-seed Materializer: it reconciles CONTACTS/<username>/<addressbook>.jsonl packs (chassis/storeseed) into the contacts store (chassis/contacts) the `contacts` personality serves.

A pack OWNS one address book of one account (managed scope). It is NDJSON:

{"addressbook":{"display_name":"…","description":"…","sort_order":0,"policy":{…}}}
{"name":"bob.vcf","uid":"…","card":{"fn":"Bob Example","emails":[{"value":"bob@example.com"}]}}
{"name":"ann.vcf","vcard":"BEGIN:VCARD\r\nVERSION:3.0\r\n…"}

The optional `addressbook` line (at most one, anywhere) sets the book's display fields; every other line is one object — `card{}` (the chassis renders vCard 3.0; `uid` defaults to <name>.<local>@<domain>) or `vcard` text kept as written. Reconcile ensures the book, puts every object (unchanged content is a no-op), and deletes every live object in the book 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). An address book this materializer CREATES gets a policy that denies client `put`/`delete` unless the header says otherwise: a client edit in a pack-owned book would be undone by the next apply. Keep runtime-written books (OnePony's `senders`) 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 CONTACTS/ packs into a *contacts.Store.

func New

func New(store *chcon.Store, shared bool) *Materializer

New builds the contacts 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 address book 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL