repository

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 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 MySQLDekRepository

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

MySQLDekRepository implements DEK persistence for MySQL. Uses BINARY(16) for UUIDs and BLOB for binary data with transaction support.

func NewMySQLDekRepository

func NewMySQLDekRepository(db *sql.DB) *MySQLDekRepository

NewMySQLDekRepository creates a new MySQL DEK repository.

func (*MySQLDekRepository) Create

func (m *MySQLDekRepository) Create(ctx context.Context, dek *cryptoDomain.Dek) error

Create inserts a new DEK into the MySQL database.

func (*MySQLDekRepository) Get

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

func (*MySQLDekRepository) Update

func (m *MySQLDekRepository) Update(ctx context.Context, dek *cryptoDomain.Dek) error

Update modifies an existing DEK in the MySQL database.

type MySQLKekRepository

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

MySQLKekRepository implements KEK persistence for MySQL. Uses BINARY(16) for UUIDs and BLOB for binary data with transaction support.

func NewMySQLKekRepository

func NewMySQLKekRepository(db *sql.DB) *MySQLKekRepository

NewMySQLKekRepository creates a new MySQL KEK repository.

func (*MySQLKekRepository) Create

func (m *MySQLKekRepository) Create(ctx context.Context, kek *cryptoDomain.Kek) error

Create inserts a new KEK into the MySQL database.

func (*MySQLKekRepository) List

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

func (*MySQLKekRepository) Update

func (m *MySQLKekRepository) Update(ctx context.Context, kek *cryptoDomain.Kek) error

Update modifies an existing KEK in the MySQL database.

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) 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