modelconfigurationpg

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package modelconfigurationpg stores deployment default model configurations in PostgreSQL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store keeps deployment defaults on pooled connections and seals and opens their bundles. It never uses the execution lease.

func New

func New(pool *pgunit.Pool, cipher *credentialcrypto.Cipher) *Store

New returns a Store that seals and opens bundles with cipher.

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, harness string) error

Delete removes the Harness's default, if any, and audits the request in the same transaction.

func (*Store) List

List reads every default in Harness order without its sealed bundle.

func (*Store) LoadBundle

func (s *Store) LoadBundle(ctx context.Context, harness string) (modelconfiguration.Bundle, error)

LoadBundle reads the columns, the sealed key and the revision in one statement, so they always belong to the same replacement, and opens the key.

func (*Store) ObserveDeploymentModelProvider

func (s *Store) ObserveDeploymentModelProvider(ctx context.Context, observation modelconfiguration.Observation) (int64, error)

ObserveDeploymentModelProvider runs one metadata UPDATE in its own pooled transaction. The statement reads only committed state: the tenant's root Turn, its outcome, the Session's deployment source and the exact frozen revision. It locks only the matching default and samples the receipt time after that lock. The transaction sets server-side statement and lock timeouts, because client cancellation alone can leave PostgreSQL executing briefly after pgx has returned a deadline error.

func (*Store) Replace

Replace seals the provider key to its Harness, upserts the record under a new revision, which clears the replaced revision's observations, and audits the write in the same transaction.

Jump to

Keyboard shortcuts

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