postgres

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package postgres provides a PostgreSQL-backed config store with versioning.

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 persists configuration versions in PostgreSQL.

func New

func New(db *sql.DB) *Store

New creates a new PostgresStore.

func (*Store) History

func (s *Store) History(ctx context.Context, limit int) ([]configstore.Revision, error)

History returns recent configuration revisions, newest first.

func (*Store) Load

func (s *Store) Load(ctx context.Context) ([]byte, error)

Load returns the active configuration as YAML bytes, or nil if no config exists yet (first boot).

func (*Store) Mode

func (*Store) Mode() string

Mode returns "database".

func (*Store) Save

func (s *Store) Save(ctx context.Context, data []byte, meta configstore.SaveMeta) error

Save persists a new configuration version, deactivating the previous one.

Jump to

Keyboard shortcuts

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