Documentation
¶
Overview ¶
Package postgresruntime composes Harbor's six PostgreSQL projections over one runtime-owned aggregate pool manager. It is deliberately separate from the individual drivers: drivers expose injected-DB constructors, while this package owns runtime topology and lifecycle.
Index ¶
- func PoolSpecs(cfg *config.Config) []postgrespool.Spec
- type Dependencies
- type Runtime
- func (r *Runtime) Artifacts(cfg config.ArtifactsConfig) (artifacts.ArtifactStore, error)
- func (r *Runtime) Memory(cfg memory.ConfigSnapshot, deps memory.Deps) (memory.MemoryStore, error)
- func (r *Runtime) Rollups(cfg rollupspg.Config) (rollups.Store, error)
- func (r *Runtime) Skills(cfg skills.ConfigSnapshot, deps skills.Deps) (skills.SkillStore, error)
- func (r *Runtime) State(ctx context.Context, cfg config.StateConfig) (state.StateStore, error)
- func (r *Runtime) Turns(cfg turnspg.Config) (turns.Store, error)
- type Subsystem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dependencies ¶
type Dependencies struct {
Bus events.EventBus
State state.StateStore
Embedder embeddings.Embedder
}
Dependencies are the non-storage collaborators needed by memory and skills. The event bus and state store are supplied by the caller because state must be opened before events and memory in the runtime graph.
type Runtime ¶
type Runtime struct {
Pools *postgrespool.Manager
}
Runtime owns the aggregate pool manager and exposes injected constructors for enabled PostgreSQL stores. Store closers never close the borrowed pools; Close is registered after store closers in the caller's reverse chain.
func Open ¶
Open creates the runtime pool manager for every enabled PostgreSQL store, including turns and rollups even though those stores are opened later by the serve band. Equal DSNs share one physical *sql.DB; distinct DSNs use the same aggregate budget.
func (*Runtime) Artifacts ¶
func (r *Runtime) Artifacts(cfg config.ArtifactsConfig) (artifacts.ArtifactStore, error)
Artifacts opens the configured artifact store over the borrowed pool.
func (*Runtime) Memory ¶
func (r *Runtime) Memory(cfg memory.ConfigSnapshot, deps memory.Deps) (memory.MemoryStore, error)
Memory opens the configured memory store over the borrowed pool.
func (*Runtime) Skills ¶
func (r *Runtime) Skills(cfg skills.ConfigSnapshot, deps skills.Deps) (skills.SkillStore, error)
Skills opens the configured skills store over the borrowed pool.
func (*Runtime) State ¶
func (r *Runtime) State(ctx context.Context, cfg config.StateConfig) (state.StateStore, error)
State opens the configured state store, borrowing a runtime pool when the Postgres driver is selected.
type Subsystem ¶
type Subsystem string
Subsystem is a Harbor-owned PostgreSQL projection included in the runtime pool contract. Keep this closed set exhaustive: adding a PostgreSQL driver requires adding its DSN selector here and its migration/schema contract in the driver package.
func ManagedSubsystems ¶
func ManagedSubsystems() []Subsystem
ManagedSubsystems returns the closed set of PostgreSQL projections that must participate in the runtime-owned pool and migration contract.