postgres

package
v0.0.0-...-2ce9d76 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package postgres persists complete policy manifests atomically in PostgreSQL.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilPool              = errors.New("authorization postgres pool is nil")
	ErrNotInitialized       = errors.New("authorization policy is not initialized")
	ErrRevisionConflict     = errors.New("authorization policy revision conflict")
	ErrRevisionNotMonotonic = errors.New("authorization policy revision is not monotonic")
)

Functions

func GoMigration

func GoMigration() (migrations.Migration, error)

Types

type Migration

type Migration struct {
	Version uint
	Name    string
	Up      string
	Down    string
}

func SchemaMigration

func SchemaMigration() Migration

type Store

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

func New

func New(pool *pgxpool.Pool) (*Store, error)

func (*Store) Load

func (store *Store) Load(ctx context.Context) (policy.Manifest, error)

func (*Store) Update

func (store *Store) Update(
	ctx context.Context,
	expected authorization.Revision,
	next policy.Manifest,
) (policy.Manifest, error)

Jump to

Keyboard shortcuts

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