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 ¶
func (m *MySQLDekRepository) Get(ctx context.Context, dekID uuid.UUID) (*cryptoDomain.Dek, error)
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 ¶
func (m *MySQLKekRepository) List(ctx context.Context) ([]*cryptoDomain.Kek, error)
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 ¶
func (p *PostgreSQLDekRepository) Create(ctx context.Context, dek *cryptoDomain.Dek) error
Create inserts a new DEK into the PostgreSQL database.
func (*PostgreSQLDekRepository) Get ¶
func (p *PostgreSQLDekRepository) Get( ctx context.Context, dekID uuid.UUID, ) (*cryptoDomain.Dek, error)
Get retrieves a DEK by its ID from the PostgreSQL database.
func (*PostgreSQLDekRepository) Update ¶
func (p *PostgreSQLDekRepository) Update(ctx context.Context, dek *cryptoDomain.Dek) error
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 ¶
func (p *PostgreSQLKekRepository) Create(ctx context.Context, kek *cryptoDomain.Kek) error
Create inserts a new KEK into the PostgreSQL database.
func (*PostgreSQLKekRepository) List ¶
func (p *PostgreSQLKekRepository) List(ctx context.Context) ([]*cryptoDomain.Kek, error)
List retrieves all KEKs ordered by version descending (newest first).
func (*PostgreSQLKekRepository) Update ¶
func (p *PostgreSQLKekRepository) Update(ctx context.Context, kek *cryptoDomain.Kek) error
Update modifies an existing KEK in the PostgreSQL database.