srcseed

package
v0.2.28 Latest Latest
Warning

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

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

Documentation

Overview

Package srcseed is the SOURCES/ store-seed Materializer: it reconciles SOURCES/<pack>.jsonl packs (chassis/storeseed) into the tenant_sources runtime table (chassis/source). A pack line DECLARES a remote source the tenant wants watched:

{"id":"support","kind":"imap","host":"imap.fastmail.com","port":993,
 "tls":"implicit","user":"desk@acme.com","secret":"ACME_DESK_MAILBOX",
 "mailbox":"INBOX","every":"5m","on_processed":"move:Processed"}

`secret` is a NAME (resolved from the encrypted secret store at poll time); a value never appears in a pack, a row, or a log. Each pack OWNS its rows: reconcile UPSERTs the declared columns of every line and SOFT-RETIRES any managed source of that pack whose id is no longer present, so a redeploy that drops a line stops the watcher without discarding its cursor (re-adding it resumes rather than re-reading the whole mailbox).

The materializer writes ONLY the declared columns; the runtime columns (cursor, claim, next_poll_at) belong to the poller. That split is what makes a redeploy safe to run against a live source.

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 SOURCES packs into a *source.Store.

func New

func New(store *source.Store) *Materializer

New builds the SOURCES Materializer over the runtime-DB source store.

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

func (*Materializer) Shared

func (m *Materializer) Shared() bool

Shared is always true: tenant_sources lives in the shared runtime DB (one Postgres on a fleet, one SQLite file on a single node), so it is reconciled exactly once — on the activation origin — and never raced by data-plane appliers.

Jump to

Keyboard shortcuts

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