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

postgresruntime

package
v1.31.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func PoolSpecs

func PoolSpecs(cfg *config.Config) []postgrespool.Spec

PoolSpecs returns one spec for every enabled PostgreSQL projection. It is the single registry used by Open, so equal DSNs are deduplicated by the pool manager and distinct DSNs remain under the same aggregate budget.

Types

type Dependencies

type Dependencies struct {
	Bus        events.EventBus
	State      state.StateStore
	Summarizer memory.Summarizer
	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

func Open(ctx context.Context, cfg *config.Config) (*Runtime, error)

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

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) Rollups

func (r *Runtime) Rollups(cfg rollupspg.Config) (rollups.Store, error)

Rollups opens the configured rollups projection 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

State opens the configured state store, borrowing a runtime pool when the Postgres driver is selected.

func (*Runtime) Turns

func (r *Runtime) Turns(cfg turnspg.Config) (turns.Store, error)

Turns opens the configured turns projection over the borrowed pool.

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.

const (
	SubsystemState                Subsystem = "state"
	SubsystemMemory               Subsystem = "memory"
	SubsystemArtifacts            Subsystem = "artifacts"
	SubsystemSkills               Subsystem = "skills"
	SubsystemSessionsTurns        Subsystem = "sessions.turns"
	SubsystemObservabilityRollups Subsystem = "observability.rollups"
)

func ManagedSubsystems

func ManagedSubsystems() []Subsystem

ManagedSubsystems returns the closed set of PostgreSQL projections that must participate in the runtime-owned pool and migration contract.

Jump to

Keyboard shortcuts

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