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

postgres

package
v1.40.4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 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