templatepg

package
v0.0.13-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 14 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 templatepg stores Environment Templates in PostgreSQL. Confidential configuration (env, setup commands, Skill and Plugin archives and initial file contents) is sealed with the credential key, each field bound to its tenant, Template and field; safe metadata is stored beside it in plaintext.

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 implements environmenttemplates.Storage and environmenttemplates.Reader.

func New

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

New returns a Store that seals and opens confidential configuration with cipher.

func (*Store) Create

func (*Store) Delete

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

func (*Store) Get

func (s *Store) Get(ctx context.Context, tenantID, templateID string) (environmenttemplates.Template, error)

func (*Store) List

List reads the cursor Template and the page in one snapshot. A cursor that names no Template of the tenant returns ErrNotFound.

func (*Store) Resolve

func (s *Store) Resolve(ctx context.Context, tenantID, templateID string) (environmenttemplates.Resolved, error)

Resolve reads one row, so the metadata and every confidential field come from the same committed version. Stored data that does not decode or match its sealed contents is corrupt, an internal error; configuration that decodes but fails current validation is ErrInvalidInput. Any malformed ID resolves to ErrNotFound.

func (*Store) Update

func (s *Store) Update(ctx context.Context, tenantID, templateID string, in environmenttemplates.Input) (environmenttemplates.Template, error)

Update seals before it looks the Template up, so a malformed ID takes the path of a missing one. Each supplied field replaces atomically in one statement, so concurrent updates of other fields are kept.

Jump to

Keyboard shortcuts

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