Documentation
¶
Overview ¶
Package seed orchestrates loading YAML config into Postgres for the app/ arch. The flow:
- Parse every YAML in the source dir (multi-doc supported).
- List every row from each entity store to learn existing name→id bindings.
- For YAML names that have no PG row yet, mint a fresh UUIDv7 and add it to the resolver map.
- Translate each DTO → domain object via manifest.ToXxx using the merged resolver, stamping Meta.ID from the same map.
- Upsert in dependency order: Provider, Host, RateLimit, HostKey, Model, Policy, RelayKey.
Diffing, dry-run, and identity (User) handling are deliberately omitted — this is the minimal "make the rows be there" path. Idempotent: re-running over the same YAML is a no-op for unchanged rows and an in-place update for changed ones.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
Pool *pgxpool.Pool
YAMLDir string
MasterKey []byte // for stored-mode HostKey rows; nil disables them
}
Options configures a seed run.
Click to show internal directories.
Click to hide internal directories.