postgresql

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package repository implements data persistence for KEKs and DEKs. Provides PostgreSQL (UUID/BYTEA) and MySQL (BINARY/BLOB) implementations with transaction support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgreSQLDekRepository

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

PostgreSQLDekRepository implements DEK persistence for PostgreSQL. Uses native UUID and BYTEA types with transaction support via database.GetTx().

func NewPostgreSQLDekRepository

func NewPostgreSQLDekRepository(db *sql.DB) *PostgreSQLDekRepository

NewPostgreSQLDekRepository creates a new PostgreSQL DEK repository.

func (*PostgreSQLDekRepository) Create

Create inserts a new DEK into the PostgreSQL database.

func (*PostgreSQLDekRepository) Get

Get retrieves a DEK by its ID from the PostgreSQL database.

func (*PostgreSQLDekRepository) GetBatchNotKekID

func (p *PostgreSQLDekRepository) GetBatchNotKekID(
	ctx context.Context,
	kekID uuid.UUID,
	limit int,
) ([]*cryptoDomain.Dek, error)

GetBatchNotKekID retrieves a batch of DEKs that are not encrypted with the given KEK ID.

func (*PostgreSQLDekRepository) Update

Update modifies an existing DEK in the PostgreSQL database.

type PostgreSQLKekRepository

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

PostgreSQLKekRepository implements KEK persistence for PostgreSQL using native UUID and BYTEA types.

func NewPostgreSQLKekRepository

func NewPostgreSQLKekRepository(db *sql.DB) *PostgreSQLKekRepository

NewPostgreSQLKekRepository creates a new PostgreSQL KEK repository.

func (*PostgreSQLKekRepository) Create

Create inserts a new KEK into the PostgreSQL database.

func (*PostgreSQLKekRepository) List

List retrieves all KEKs ordered by version descending (newest first).

func (*PostgreSQLKekRepository) Update

Update modifies an existing KEK in the PostgreSQL database.

Jump to

Keyboard shortcuts

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